Remove test code I didn't end up using

This commit is contained in:
Timothy Baldridge 2020-02-04 22:21:08 -07:00
parent 1dd2e35828
commit cda2a5f54c

View File

@ -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;
}
}
}