public TreeNode getDirectoryChildren(HFSPlusCatalogFolder folderRecord, catalogFile cf, extentsOverflowFile eof, attributesFile af) { TreeNode returnDir = new TreeNode(); // get every file and directory inside the current one returnDir = cf.getDirectoryAndChildren(folderRecord, eof, this.partitionNo); foreach (TreeNode child in returnDir.Nodes) { // check if there are any alternate data streams for the files if (child.Tag is HFSPlusCatalogFile) { HFSPlusCatalogFile data = (HFSPlusCatalogFile)child.Tag; attributesFile.HFSPlusAttrKey attrKey = new attributesFile.HFSPlusAttrKey(); attrKey.fileID = data.fileID; attrKey.startBlock = 0; attributesLeafNode.attributesDataForFile allAttributes = af.getAttrFileDataWithKey(attrKey); foreach (attributesLeafNode.HFSPlusAttrForkData fork in allAttributes.forks) { TreeNode attribute = new TreeNode(); attributesLeafNode.HFSPlusAttrForkData tag = fork; tag.partitionAssoc = folderRecord.partitionAssoc; attribute.Text = child.Text + " > " + System.Text.Encoding.BigEndianUnicode.GetString(fork.key.attrName); attribute.Tag = tag; returnDir.Nodes.Add(attribute); } foreach (attributesLeafNode.HFSPlusAttrInlineData inline in allAttributes.inline) { TreeNode attribute = new TreeNode(); attributesLeafNode.HFSPlusAttrInlineData tag = inline; tag.partitionAssoc = folderRecord.partitionAssoc; attribute.Text = child.Text + " > " + System.Text.Encoding.BigEndianUnicode.GetString(inline.key.attrName); attribute.Tag = tag; returnDir.Nodes.Add(attribute); } } } return(returnDir); }
public TreeNode getDirectoryChildren(HFSPlusCatalogFolder folderRecord, catalogFile cf, extentsOverflowFile eof, attributesFile af) { TreeNode returnDir = new TreeNode(); // get every file and directory inside the current one returnDir = cf.getDirectoryAndChildren(folderRecord, eof, this.partitionNo); foreach (TreeNode child in returnDir.Nodes) { // check if there are any alternate data streams for the files if (child.Tag is HFSPlusCatalogFile) { HFSPlusCatalogFile data = (HFSPlusCatalogFile)child.Tag; attributesFile.HFSPlusAttrKey attrKey = new attributesFile.HFSPlusAttrKey(); attrKey.fileID = data.fileID; attrKey.startBlock = 0; attributesLeafNode.attributesDataForFile allAttributes = af.getAttrFileDataWithKey(attrKey); foreach (attributesLeafNode.HFSPlusAttrForkData fork in allAttributes.forks) { TreeNode attribute = new TreeNode(); attributesLeafNode.HFSPlusAttrForkData tag = fork; tag.partitionAssoc = folderRecord.partitionAssoc; attribute.Text = child.Text + " > " + System.Text.Encoding.BigEndianUnicode.GetString(fork.key.attrName); attribute.Tag = tag; returnDir.Nodes.Add(attribute); } foreach (attributesLeafNode.HFSPlusAttrInlineData inline in allAttributes.inline) { TreeNode attribute = new TreeNode(); attributesLeafNode.HFSPlusAttrInlineData tag = inline; tag.partitionAssoc = folderRecord.partitionAssoc; attribute.Text = child.Text + " > " + System.Text.Encoding.BigEndianUnicode.GetString(inline.key.attrName); attribute.Tag = tag; returnDir.Nodes.Add(attribute); } } } return returnDir; }