private void GenPathTableEx(IsoFolder parentFolder, IsoFolder thisFolder, bool lsb) { var di = new FieldValidator(this.generator); // Path table record ( ECMA-119 section 9.4 ) byte[] b_di = this.generator.IsoName(thisFolder.Name, true); di.Byte((byte)b_di.Length, 1); di.Byte(0, 2); // Extended Attribute Record Length if (lsb) { di.IntLSB(thisFolder.DataBlock, 3, 6); // Location of Extent di.ShortLSB(parentFolder.PathTableEntry, 7, 8); // Parent Directory Number } else { di.IntMSB(thisFolder.DataBlock, 3, 6); // Location of Extent di.ShortMSB(parentFolder.PathTableEntry, 7, 8); // Parent Directory Number } di.Bytes(b_di, 9, 8 + b_di.Length); // Directory Identifier if ((b_di.Length & 1) != 0) { di.Byte(0, 9 + b_di.Length); // optional padding if LEN_DI is odd } foreach (KeyValuePair <string, IsoEntry> it in thisFolder.entries) { if (it.Value.IsFolder) { GenPathTableEx(thisFolder, (IsoFolder)it.Value, lsb); } } }
private void GenPrimaryVolumeDescriptor() // ( 8.4 ) { PrimaryVolumeDescriptor = this.generator.Index / LogicalBlockSize; var pvd = new FieldValidator(this.generator); pvd.Byte(1, 1); // Volume Descriptor Type ( 8.4.1 ) pvd.AString("CD001", 2, 6); // Standard Identifier ( 8.4.2 ) pvd.Byte(1, 7); // Volume Descriptor Version ( 8.4.3 ) pvd.Zero(8, 8); // Unused Field ( 8.4.4 ) pvd.AString("?", 9, 40); // System Identifier ( 8.4.5 ) pvd.DString(this.volumeLabel, 41, 72); // Volume Identifier ( 8.4.6 ) pvd.Zero(73, 80); // Unused Field ( 8.4.7 ) pvd.IntLSBMSB((TotalSize + LogicalBlockSize - 1) / LogicalBlockSize, 81, 88); // Volume Space Size ( 8.4.8 ) pvd.Zero(89, 120); // Unused Field ( 8.4.9 ) pvd.ShortLSBMSB(1, 121, 124); // Volume Set Size ( 8.4.10 ) pvd.ShortLSBMSB(1, 125, 128); // Volume Sequence Number ( 8.4.11 ) pvd.ShortLSBMSB(LogicalBlockSize, 129, 132); // Logical Block Size ( 8.4.12 ) pvd.IntLSBMSB(PathTableSize, 133, 140); // Path Table Size ( 8.4.13 ) pvd.IntLSB(LPathTable, 141, 144); // L Path Table ( 8.4.14 ) pvd.IntLSB(0, 145, 148); // Optional L Path Table ( 8.4.15 ) pvd.IntMSB(MPathTable, 149, 152); // M Path Table ( 8.4.16 ) pvd.IntMSB(0, 153, 156); // Optional M Path Table ( 8.4.17 ) pvd.BeginField(157); DirectoryRecord(".", this.isoRoot, 1); // Directory Record for Root Directory ( 8.4.18 ) pvd.EndField(190); pvd.DupByte(0x20, 191, 318); // Volume Set Identifier ( 8.4.19 ) pvd.DupByte(0x20, 319, 446); // Publisher Identifier ( 8.4.20 ) pvd.DupByte(0x20, 447, 574); // Data Preparer ( 8.4.21 ) pvd.DupByte(0x20, 575, 702); // Application Identifier ( 8.4.22 ) pvd.DupByte(0x20, 703, 739); // Copyright File Identifier ( 8.4.23 ) pvd.DupByte(0x20, 740, 776); // Abstract File Identifier ( 8.4.24 ) pvd.DupByte(0x20, 777, 813); // Bibliographic File Identifier ( 8.4.25 ) System.DateTime now = System.DateTime.Now; pvd.AnsiDateTime(now, 814, 830); // Volume Creation Date and Time ( 8.4.26 ) pvd.AnsiDateTime(now, 831, 847); // Volume Modification Date and Time ( 8.4.27 ) pvd.Zero(848, 864); // Volume Expiration Date and Time ( 8.4.28 ) pvd.Zero(865, 881); // Volume Effective Date and Time ( 8.4.29 ) pvd.Byte(1, 882); // File Structure Version ( 8.4.30 ) pvd.Zero(883, 883); // Reserved ( 8.4.31 ) pvd.Zero(884, 1395); // Application Use ( 8.4.32 ) pvd.Zero(1396, 2048); // Reserved for Future Standardization ( 8.4.33 ) }
private void GenPathTableEx(IsoFolder parentFolder, IsoFolder thisFolder, bool lsb) { var di = new FieldValidator(this.generator); // Path table record ( ECMA-119 section 9.4 ) byte[] b_di = this.generator.IsoName(thisFolder.Name, true); di.Byte((byte)b_di.Length, 1); di.Byte(0, 2); // Extended Attribute Record Length if (lsb) { di.IntLSB(thisFolder.DataBlock, 3, 6); // Location of Extent di.ShortLSB(parentFolder.PathTableEntry, 7, 8); // Parent Directory Number } else { di.IntMSB(thisFolder.DataBlock, 3, 6); // Location of Extent di.ShortMSB(parentFolder.PathTableEntry, 7, 8); // Parent Directory Number } di.Bytes(b_di, 9, 8 + b_di.Length); // Directory Identifier if ((b_di.Length & 1) != 0) di.Byte(0, 9 + b_di.Length); // optional padding if LEN_DI is odd foreach (KeyValuePair<string, IsoEntry> it in thisFolder.entries) if (it.Value.IsFolder) GenPathTableEx(thisFolder, (IsoFolder)it.Value, lsb); }