From cda2a5f54cbc1a006f41b5a8dccbdf03c7bfa258 Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Tue, 4 Feb 2020 22:21:08 -0700 Subject: [PATCH] Remove test code I didn't end up using --- Wabbajack.Common/Paths.cs | 62 --------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 Wabbajack.Common/Paths.cs diff --git a/Wabbajack.Common/Paths.cs b/Wabbajack.Common/Paths.cs deleted file mode 100644 index a9ae970d..00000000 --- a/Wabbajack.Common/Paths.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using APath = Alphaleonis.Win32.Filesystem.Path; -using AFile = Alphaleonis.Win32.Filesystem.File; -using Directory = System.IO.Directory; -using FileInfo = Alphaleonis.Win32.Filesystem.FileInfo; - -namespace Wabbajack.Common.Paths -{ - public struct File - { - internal readonly string _path; - - public Directory Parent - { - get - { - var parent = APath.GetDirectoryName(_path); - if (parent == "") - { - throw new NoParentDirectoryException(_path); - } - return new Directory(parent); - } - } - - public bool Exists => AFile.Exists(_path); - public bool IsTopLevelFile => APath.GetDirectoryName(_path) == null; - public string Extension => APath.GetExtension(_path); - public long Length => new FileInfo(_path).Length; - - private File(string path) - { - _path = path; - } - public FileStream Create() - { - return AFile.Create(_path); - } - } - - public struct Directory - { - private string _path; - - internal Directory(string path) - { - _path = path; - } - } - - public class NoParentDirectoryException : Exception - { - private string _path; - - public NoParentDirectoryException(string path) : base($"Cannot get the parent directory of a top level directory: {path}") - { - _path = path; - } - } -}