private ReleaseManifestDirectoryDescriptor ReadDirectoryDescriptor() { ReleaseManifestDirectoryDescriptor result = new ReleaseManifestDirectoryDescriptor(); result.NameIndex = _reader.ReadUInt32(); result.SubdirectoryStart = _reader.ReadUInt32(); result.SubdirectoryCount = _reader.ReadUInt32(); result.FileStart = _reader.ReadUInt32(); result.FileCount = _reader.ReadUInt32(); return(result); }
public ReleaseManifestDirectoryEntry(uint directoryId, ReleaseManifest manifest, ReleaseManifestDirectoryDescriptor descriptor, ReleaseManifestDirectoryEntry parent) { Id = directoryId; ReleaseManifest = manifest; Descriptor = descriptor; Parent = parent; if (parent != null) { parent.Directories.Add(this); } Directories = new List <ReleaseManifestDirectoryEntry>((int)descriptor.SubdirectoryCount); Files = new List <ReleaseManifestFileEntry>((int)descriptor.FileCount); }
private void DeserializeTreeifyDirectoryDescriptor(uint directoryId, ReleaseManifestDirectoryEntry parent = null) { ReleaseManifestDirectoryDescriptor directoryDescriptor = _directoryDescriptors[directoryId]; ReleaseManifestDirectoryEntry directoryNode = new ReleaseManifestDirectoryEntry(directoryId, _manifest, directoryDescriptor, parent); _directoryTable[directoryId] = directoryNode; if (directoryDescriptor.FileCount != 0) { uint lastFileId = directoryDescriptor.FileStart + directoryDescriptor.FileCount; for (uint fileId = directoryDescriptor.FileStart; fileId < lastFileId; fileId++) { _fileParentTable[fileId] = directoryNode; } } uint lastSubdirectoryId = directoryDescriptor.SubdirectoryStart + directoryDescriptor.SubdirectoryCount; for (uint subDirectoryId = directoryDescriptor.SubdirectoryStart; subDirectoryId < lastSubdirectoryId; subDirectoryId++) { DeserializeTreeifyDirectoryDescriptor(subDirectoryId, directoryNode); } }