Example #1
0
 public ReleaseManifestFileEntry(uint fileId, ReleaseManifest releaseManifest, ReleaseManifestFileEntryDescriptor fileDescriptor, ReleaseManifestDirectoryEntry parent)
 {
     Id = fileId;
     ReleaseManifest = releaseManifest;
     Descriptor      = fileDescriptor;
     Parent          = parent;
     Parent.Files.Add(this);
 }
Example #2
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);
 }
        public ReleaseManifest Read()
        {
            _manifest = new ReleaseManifest();
            _manifest.FileLocation = FileLocation;

            _stream = new MemoryStream(File.ReadAllBytes(FileLocation));
            _reader = new BinaryReader(_stream);

            DeserializeHeader();
            DeserializeSkipFileSystemBody();
            DeserializeStringTable();
            DeserializeFileSystemBody();

            return(_manifest);
        }
        public static ReleaseManifest Generate(string path, Dictionary <string, Archive> files, uint version)
        {
            var manifest = new ReleaseManifest();

            manifest.FileLocation         = path;
            manifest.Header               = new ReleaseManifestHeader();
            manifest.Header.EntityVersion = version;
            manifest.Header.FormatVersion = 65537;
            manifest.Header.Magic         = 1297304658;
            manifest.Header.UnknownCount  = 77266;
            //manifest.Directories = new ReleaseManifestDirectoryEntry[0];
            //manifest.Files = new ReleaseManifestFileEntry[0];
            //manifest.Strings = new StringTable();
            manifest.SaveChanges();

            var dirs = new List <ReleaseManifestDirectoryEntry>();

            var descriptor = new ReleaseManifestDirectoryDescriptor();

            new ReleaseManifestDirectoryEntry(0, manifest, descriptor, null);

            return(manifest);
        }
 public ReleaseManifestWriter(ReleaseManifest manifest)
 {
     _manifest = manifest;
 }