private void BuildFSDirectory(DirectoryEntry dirEntry, Directory fsDirectory) { fsDirectory.Name = dirEntry.Name; for (var i = 0; i < dirEntry.DirectoryCount; i++) { var dir = new Directory(); BuildFSDirectory(dirEntry.GetDirectory(i), dir); dir.ParentDirectory = fsDirectory; fsDirectory.AddObject(dir); } for (var i = 0; i < dirEntry.FileCount; i++) { var fileEntry = dirEntry.GetFile(i); File file; file = new File( () => (_customData.ContainsKey(fileEntry.FullName) ? _customData[fileEntry.FullName] : fileEntry.GetData()), data => _customData[fileEntry.FullName] = data, () => _customData.ContainsKey(fileEntry.FullName) ); file.CompressedSize = fileEntry.Size; file.IsCompressed = false; file.Name = fileEntry.Name; file.Size = fileEntry.Size; file.IsResource = fileEntry.IsResourceFile; file.ResourceType = fileEntry.ResourceType; file.ParentDirectory = fsDirectory; fsDirectory.AddObject(file); } }
private void BuildFSDirectory(DirectoryEntry dirEntry, Directory fsDirectory) { fsDirectory.Name = GetName(dirEntry); for (int i = 0; i < dirEntry.ContentEntryCount; i++) { TOCEntry entry = _rpfFile.TOC[dirEntry.ContentEntryIndex + i]; if (entry.IsDirectory) { var dir = new Directory(); BuildFSDirectory(entry as DirectoryEntry, dir); dir.ParentDirectory = fsDirectory; fsDirectory.AddObject(dir); } else { var fileEntry = entry as FileEntry; Common.File.DataLoadDelegate load = () => LoadData(fileEntry); Common.File.DataStoreDelegate store = data => StoreData(fileEntry, data); Common.File.DataIsCustomDelegate isCustom = () => fileEntry.CustomData != null; var file = new Common.File(load, store, isCustom); file.CompressedSize = fileEntry.SizeInArchive; file.IsCompressed = fileEntry.IsCompressed; file.Name = GetName(fileEntry); file.Size = fileEntry.Size; file.IsResource = fileEntry.IsResourceFile; file.ResourceType = fileEntry.ResourceType; file.ParentDirectory = fsDirectory; fsDirectory.AddObject(file); } } }
private void BuildFSDirectory(DirectoryEntry dirEntry, Directory fsDirectory) { fsDirectory.Name = dirEntry.Name; for (var i = 0; i < dirEntry.DirectoryCount; i++ ) { var dir = new Directory(); BuildFSDirectory(dirEntry.GetDirectory(i), dir); dir.ParentDirectory = fsDirectory; fsDirectory.AddObject(dir); } for (var i = 0; i < dirEntry.FileCount; i++ ) { var fileEntry = dirEntry.GetFile(i); File file; file = new File( ()=> (_customData.ContainsKey(fileEntry.FullName) ? _customData[fileEntry.FullName] : fileEntry.GetData()), data => _customData[fileEntry.FullName] = data, () => _customData.ContainsKey(fileEntry.FullName) ); file.CompressedSize = fileEntry.Size; file.IsCompressed = false; file.Name = fileEntry.Name; file.Size = fileEntry.Size; file.IsResource = fileEntry.IsResourceFile; file.ResourceType = fileEntry.ResourceType; file.ParentDirectory = fsDirectory; fsDirectory.AddObject(file); } }
private void BuildFSDirectory(DirectoryEntry dirEntry, Directory fsDirectory) { fsDirectory.Name = GetName(dirEntry); for (int i = 0; i < dirEntry.ContentEntryCount; i++) { TOCEntry entry = _rpfFile.TOC[dirEntry.ContentEntryIndex + i]; if (entry.IsDirectory) { var dir = new Directory(); BuildFSDirectory(entry as DirectoryEntry, dir); dir.ParentDirectory = fsDirectory; fsDirectory.AddObject(dir); } else { var fileEntry = entry as FileEntry; Common.File.DataLoadDelegate load = () => LoadData(fileEntry); Common.File.DataStoreDelegate store = data => StoreData(fileEntry, data); Common.File.DataIsCustomDelegate isCustom = () => fileEntry.CustomData != null; var file = new Common.File(load, store, isCustom); file.CompressedSize = fileEntry.SizeInArchive; file.IsCompressed = fileEntry.IsCompressed; file.Name = GetName(fileEntry); file.Size = fileEntry.Size; file.IsResource = fileEntry.IsResourceFile; file.ResourceType = fileEntry.ResourceType; file.ParentDirectory = fsDirectory; fsDirectory.AddObject(file); } } }