LibHac/libhac.Nand/NandPartition.cs

54 lines
1.3 KiB
C#
Raw Normal View History

using System.IO;
using System.Linq;
using DiscUtils.Fat;
namespace libhac.Nand
{
public class NandPartition : IFileSystem
{
public FatFileSystem Fs { get; }
public NandPartition(FatFileSystem fileSystem)
{
Fs = fileSystem;
}
public bool FileExists(string path)
{
return Fs.FileExists(path);
}
public bool DirectoryExists(string path)
{
return Fs.DirectoryExists(path);
}
public Stream OpenFile(string path, FileMode mode)
{
return Fs.OpenFile(path, mode);
}
public Stream OpenFile(string path, FileMode mode, FileAccess access)
{
return Fs.OpenFile(path, mode, access);
}
public string[] GetFileSystemEntries(string path, string searchPattern)
{
return Fs.GetFileSystemEntries(path, searchPattern);
}
public string[] GetFileSystemEntries(string path, string searchPattern, SearchOption searchOption)
{
var files = Fs.GetFiles(path, searchPattern, searchOption);
var dirs = Fs.GetDirectories(path, searchPattern, searchOption);
return files.Concat(dirs).ToArray();
}
public string GetFullPath(string path)
{
return path;
}
}
}