Пример #1
0
 public SaveDataFile(AllocationTableStorage baseStorage, string path, HierarchicalSaveFileTable fileTable, long size, OpenMode mode)
 {
     Mode        = mode;
     BaseStorage = baseStorage;
     Path        = path;
     FileTable   = fileTable;
     Size        = size;
 }
Пример #2
0
        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));
        }
Пример #3
0
        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);
        }
Пример #4
0
        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));
        }