public SaveDataFile(AllocationTableStorage baseStorage, string path, HierarchicalSaveFileTable fileTable, long size, OpenMode mode) { Mode = mode; BaseStorage = baseStorage; Path = path; FileTable = fileTable; Size = size; }
public IFile OpenFile(string path, OpenMode mode) { path = PathTools.Normalize(path); if (!FileTable.TryOpenFile(path, out SaveFileInfo file)) { throw new FileNotFoundException(); } AllocationTableStorage storage = OpenFatStorage(file.StartBlock); return(new SaveDataFile(storage, path, FileTable, file.Length, mode)); }
public SaveDataFileSystemCore(IStorage storage, IStorage allocationTable, IStorage header) { HeaderStorage = header; BaseStorage = storage; AllocationTable = new AllocationTable(allocationTable, header.Slice(0x18, 0x30)); Header = new SaveHeader(HeaderStorage); AllocationTableStorage dirTableStorage = OpenFatStorage(AllocationTable.Header.DirectoryTableBlock); AllocationTableStorage fileTableStorage = OpenFatStorage(AllocationTable.Header.FileTableBlock); FileTable = new HierarchicalSaveFileTable(dirTableStorage, fileTableStorage); }
public IFile OpenFile(string path, OpenMode mode) { path = PathTools.Normalize(path); if (!FileTable.TryOpenFile(path, out SaveFileInfo file)) { ThrowHelper.ThrowResult(ResultFs.PathNotFound); } AllocationTableStorage storage = OpenFatStorage(file.StartBlock); return(new SaveDataFile(storage, path, FileTable, file.Length, mode)); }