mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 20:39:01 +00:00
41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
using System.Collections.Generic;
|
|
using System.IO;
|
|
using Cosmos.HAL.BlockDevice;
|
|
using Cosmos.System.FileSystem.FAT;
|
|
using Cosmos.System.FileSystem.Listing;
|
|
|
|
namespace Cosmos.System.FileSystem
|
|
{
|
|
public abstract class FileSystem
|
|
{
|
|
protected FileSystem(Partition aDevice, string aRootPath)
|
|
{
|
|
mDevice = aDevice;
|
|
mRootPath = aRootPath;
|
|
}
|
|
|
|
public static FileSystemType GetFileSystemType(Partition aDevice)
|
|
{
|
|
if (FatFileSystem.IsDeviceFAT(aDevice))
|
|
{
|
|
return FileSystemType.FAT;
|
|
}
|
|
|
|
return FileSystemType.Unknown;
|
|
}
|
|
|
|
public abstract void DisplayFileSystemInfo();
|
|
|
|
public abstract List<DirectoryEntry> GetDirectoryListing(DirectoryEntry baseDirectory);
|
|
|
|
public abstract DirectoryEntry GetRootDirectory();
|
|
|
|
public abstract DirectoryEntry CreateDirectory(DirectoryEntry aParentDirectory, string aNewDirectory);
|
|
|
|
public abstract DirectoryEntry CreateFile(DirectoryEntry aParentDirectory, string aNewFile);
|
|
|
|
protected Partition mDevice { get; }
|
|
|
|
public string mRootPath { get; }
|
|
}
|
|
}
|