コード例 #1
0
 public void SerializeDirectory(ReleaseManifestDirectoryEntry directory)
 {
     _writer.Write(directory.NameStringTableIndex);
     _writer.Write(directory.SubdirectoryStart);
     _writer.Write(directory.SubdirectoryCount);
     _writer.Write(directory.FileStart);
     _writer.Write(directory.FileCount);
 }
コード例 #2
0
 public ReleaseManifestFileEntry(uint fileId, ReleaseManifest releaseManifest, ReleaseManifestFileEntryDescriptor fileDescriptor, ReleaseManifestDirectoryEntry parent)
 {
     Id = fileId;
     ReleaseManifest = releaseManifest;
     Descriptor      = fileDescriptor;
     Parent          = parent;
     Parent.Files.Add(this);
 }
コード例 #3
0
 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);
 }
コード例 #4
0
        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);
            }
        }