//private byte[] m_Array; public PDBheader(Header header) { int temp; if (header.Length < 80) { throw new Exception("PDB header is too small"); } m_Array = header; // Filename. Bytes 0-32 null terminated ASCII m_Filename = m_Array.ReadString(0, 32); m_Filename = m_Filename.Substring(0, m_Filename.IndexOf('\0')); // Version - Bytes 34-2 high-endian integer; m_Version = m_Array.ReadShort(34); // Creation date - Bytes 36-4 high-endian integer. Despite the comments // above, the time is based on 1-Jan-1970 not 1-Jan-1904 temp = m_Array.ReadInt(36); m_CreationDate = new DateTime(1970, 1, 1, 0, 0, 0); m_CreationDate = m_CreationDate.AddSeconds((double)temp); // Modification date - Bytes 40-4 high-endian integer. Despite the comments // above, the time is based on 1-Jan-1970 not 1-Jan-1904 temp = m_Array.ReadInt(40); m_ModificationDate = new DateTime(1970, 1, 1, 0, 0, 0); m_ModificationDate = m_ModificationDate.AddSeconds((double)temp); // Type - Bytes 60-4 ASCII m_Type = m_Array.ReadString(60, 4); // Creator - Bytes 64-4 ASCII m_Creator = m_Array.ReadString(64, 4); // Record count - Bytes 76-2 high-endian integer; m_RecordCnt = m_Array.ReadShort(76); // Build a list of pointers to records. These are held in an array // starting in bytes 78-8. m_RecPointer = new ArrayList(m_RecordCnt); for (int i = 0; i < m_RecordCnt; i++) { int offs = 78 + (i * 8); temp = m_Array.ReadInt(offs); m_RecPointer.Add(temp); } }
public PRCheader(Header header) { // Compression : Bytes 0-2 big-endian integer m_Compression = header.ReadShort(0); // Uncompressed Text Length: Bytes 4-4 big-endian integer m_UncompTextLen = header.ReadInt(4); m_UncompTextLen += 2; // allow for trailing CRLF // record Count : Bytes 8-2 big-endian integer m_PRCrecCnt = header.ReadShort(8); // Max record lenth : Bytes 10-2 big-endian integer m_MaxRecLen = header.ReadShort(10); // Encryption : Bytes 12-2 big-endian integer m_Encryption = header.ReadShort(12); }
//private byte[] m_Array; public PDBheader(Header header) { int temp; if (header.Length < 80) throw new Exception("PDB header is too small"); m_Array = header; // Filename. Bytes 0-32 null terminated ASCII m_Filename = m_Array.ReadString(0, 32); m_Filename = m_Filename.Substring(0, m_Filename.IndexOf('\0')); // Version - Bytes 34-2 high-endian integer; m_Version = m_Array.ReadShort(34); // Creation date - Bytes 36-4 high-endian integer. Despite the comments // above, the time is based on 1-Jan-1970 not 1-Jan-1904 temp = m_Array.ReadInt(36); m_CreationDate = new DateTime(1970, 1, 1, 0, 0, 0); m_CreationDate = m_CreationDate.AddSeconds((double)temp); // Modification date - Bytes 40-4 high-endian integer. Despite the comments // above, the time is based on 1-Jan-1970 not 1-Jan-1904 temp = m_Array.ReadInt(40); m_ModificationDate = new DateTime(1970, 1, 1, 0, 0, 0); m_ModificationDate = m_ModificationDate.AddSeconds((double)temp); // Type - Bytes 60-4 ASCII m_Type = m_Array.ReadString(60, 4); // Creator - Bytes 64-4 ASCII m_Creator = m_Array.ReadString(64, 4); // Record count - Bytes 76-2 high-endian integer; m_RecordCnt = m_Array.ReadShort(76); // Build a list of pointers to records. These are held in an array // starting in bytes 78-8. m_RecPointer = new ArrayList(m_RecordCnt); for (int i = 0; i < m_RecordCnt; i++) { int offs = 78 + (i * 8); temp = m_Array.ReadInt(offs); m_RecPointer.Add(temp); } }