internal void Update(IsoDirectoryRecord record) { mHeader.directoryRecordLBA = record.LBA; for (int i = 0; i < mHeader.entryCount; i++) { // slow but lenient Array.Find(mSubEntries, elem => elem.Name == record.SubEntries[i].Name).Update(record.SubEntries[i]); } }
internal void Update(IsoDirectoryRecord record) { if (mHeader.name != record.Name) { Console.WriteLine("Warning: CVM entry name mismatch! Expected: \"{0}\" Got: \"{1}\"", mHeader.name, record.Name); } mHeader.size = record.Size; mHeader.LBA = record.LBA; if (mDirList != null) { mDirList.Update(record); } }
private void InternalRead(BinaryReader reader) { reader.Seek(CVM_HEADER_SIZE + ISO_RESERVED_SIZE, SeekOrigin.Begin); byte sectorType = reader.ReadByte(); while (sectorType != ID_PRIM_VOLUME_DESC) { reader.Seek(ISO_BLOCKSIZE - 1, SeekOrigin.Current); sectorType = reader.ReadByte(); } reader.Seek(ISO_ROOTDIRECTORY_OFFSET - 1, SeekOrigin.Current); mRootDirectory = new IsoDirectoryRecord(reader, null); }
private string GetPath(IList <IsoPathRecord> pathRecords, IsoDirectoryRecord directoryRecord, IsoPathRecord pathRecord) { var currentPath = pathRecord; var output = new List <string> { directoryRecord.Identifier }; while (currentPath.ParentDirectoryNumber != 0) { output.Add(currentPath.DirectoryIdentifier); var newPath = pathRecords[currentPath.ParentDirectoryNumber - 1]; if (newPath == currentPath) { break; } currentPath = newPath; } output.Reverse(); return(string.Join("/", output.Where(o => !string.IsNullOrEmpty(o)))); }