private void getRecords() { foreach (rawKeyAndRecord record in this.rawRecords) { short thisRecordType = dataOperations.convToLE(BitConverter.ToInt16(record.recordData, 0)); catalogFile.HFSPlusCatalogKey key = new catalogFile.HFSPlusCatalogKey(); key.keyLength = record.keyLength; key.parentID = dataOperations.convToLE(BitConverter.ToUInt32(record.keyData, 0)); byte[] nodeName = new byte[record.keyLength - 6]; Array.Copy(record.keyData, 6, nodeName, 0, record.keyLength - 6); key.nodeName = nodeName; byte[] rawData = record.recordData; switch ((recordType)thisRecordType) { case recordType.kHFSFileRecord: HFSPlusCatalogFile fileRecord = new HFSPlusCatalogFile(ref rawData); fileRecord.key = key; fileRecords.Add(fileRecord); break; case recordType.kHFSFolderRecord: HFSPlusCatalogFolder folderRecord = new HFSPlusCatalogFolder(ref rawData); folderRecord.key = key; folderRecords.Add(folderRecord); break; case recordType.kHFSFileThreadRecord: case recordType.kHFSFolderThreadRecord: HFSPlusCatalogThread threadRecord = new HFSPlusCatalogThread(); threadRecord.key = key; threadRecord.type = (recordType)thisRecordType; threadRecord.reserved = dataOperations.convToLE(BitConverter.ToInt16(rawData, 2)); threadRecord.parentID = dataOperations.convToLE(BitConverter.ToUInt32(rawData, 4)); threadRecord.nodeName = new byte[rawData.Length - 8]; Array.Copy(rawData, 8, threadRecord.nodeName, 0, rawData.Length - 8); threadRecords.Add(threadRecord); break; } } }
private void getRecords() { foreach(rawKeyAndRecord record in this.rawRecords) { short thisRecordType = dataOperations.convToLE(BitConverter.ToInt16(record.recordData, 0)); catalogFile.HFSPlusCatalogKey key = new catalogFile.HFSPlusCatalogKey(); key.keyLength = record.keyLength; key.parentID = dataOperations.convToLE(BitConverter.ToUInt32(record.keyData, 0)); byte[] nodeName = new byte[record.keyLength - 6]; Array.Copy(record.keyData, 6, nodeName, 0, record.keyLength - 6); key.nodeName = nodeName; byte[] rawData = record.recordData; switch ((recordType)thisRecordType) { case recordType.kHFSFileRecord: HFSPlusCatalogFile fileRecord = new HFSPlusCatalogFile(ref rawData); fileRecord.key = key; fileRecords.Add(fileRecord); break; case recordType.kHFSFolderRecord: HFSPlusCatalogFolder folderRecord = new HFSPlusCatalogFolder(ref rawData); folderRecord.key = key; folderRecords.Add(folderRecord); break; case recordType.kHFSFileThreadRecord: case recordType.kHFSFolderThreadRecord: HFSPlusCatalogThread threadRecord = new HFSPlusCatalogThread(); threadRecord.key = key; threadRecord.type = (recordType)thisRecordType; threadRecord.reserved = dataOperations.convToLE(BitConverter.ToInt16(rawData, 2)); threadRecord.parentID = dataOperations.convToLE(BitConverter.ToUInt32(rawData, 4)); threadRecord.nodeName = new byte[rawData.Length - 8]; Array.Copy(rawData, 8, threadRecord.nodeName, 0, rawData.Length - 8); threadRecords.Add(threadRecord); break; } } }
public static catalogFile.HFSPlusCatalogKey buildCatalogTrialKey(absIndexOrLeafNode.rawKeyAndRecord record) { catalogFile.HFSPlusCatalogKey result = new catalogFile.HFSPlusCatalogKey(); result.parentID = dataOperations.convToLE(BitConverter.ToUInt32(record.keyData, 0)); result.nodeName = new byte[record.keyLength - 4]; Array.Copy(record.keyData, 4, result.nodeName, 0, record.keyLength - 4); result.keyLength = record.keyLength; return(result); }
public static catalogFile.HFSPlusCatalogKey buildCatalogTrialKey(absIndexOrLeafNode.rawKeyAndRecord record) { catalogFile.HFSPlusCatalogKey result = new catalogFile.HFSPlusCatalogKey(); result.parentID = dataOperations.convToLE(BitConverter.ToUInt32(record.keyData, 0)); result.nodeName = new byte[record.keyLength - 4]; Array.Copy(record.keyData, 4, result.nodeName, 0, record.keyLength - 4); result.keyLength = record.keyLength; return result; }