예제 #1
0
        public TableContext(NodeDataDTO nodeData)
        {
            NodeData = nodeData;
            HeapNode = new HN(NodeData);

            var tcinfoHID      = HeapNode.HeapNodes[0].Header.UserRoot;
            var tcinfoHIDbytes = HeapNode.GetHIDBytes(tcinfoHID);

            TCHeader = new TCINFOHEADER(tcinfoHIDbytes.Data);

            RowIndexBTH     = new BTH(HeapNode, TCHeader.RowIndexLocation);
            ReverseRowIndex = new Dictionary <uint, uint>();
            foreach (var prop in RowIndexBTH.Properties)
            {
                var temp = BitConverter.ToUInt32(prop.Value.Data, 0);
                ReverseRowIndex.Add(temp, BitConverter.ToUInt32(prop.Key, 0));
            }
            RowMatrix = new TCRowMatrix(this, RowIndexBTH);
        }
예제 #2
0
파일: BTH.cs 프로젝트: lacour-it/PST-Parser
        public BTH(HN heapNode, HID userRoot = null)
        {
            HeapNode = heapNode;

            var bthHeaderHID = userRoot ?? heapNode.HeapNodes[0].Header.UserRoot;

            Header = new BTHHEADER(HeapNodeBO.GetHNHIDBytes(heapNode, bthHeaderHID));
            Root   = new BTHIndexNode(Header.BTreeRoot, this, (int)Header.NumLevels);

            Properties = new Dictionary <byte[], BTHDataEntry>(new ArrayUtilities.ByteArrayComparer());

            var stack = new Stack <BTHIndexNode>();

            stack.Push(Root);
            while (stack.Count > 0)
            {
                var cur = stack.Pop();

                try
                {
                    if (cur.Data != null)
                    {
                        foreach (var entry in cur.Data.DataEntries)
                        {
                            Properties.Add(entry.Key, entry);
                        }
                    }
                }
                catch (Exception ex)
                {
                    throw new Exception("Cannot display this view.  Failed to create all properties in this location", ex);
                }


                if (cur.Children != null)
                {
                    foreach (var child in cur.Children)
                    {
                        stack.Push(child);
                    }
                }
            }
        }
예제 #3
0
        public static HNDataDTO GetHNHIDBytes(HN heapNode, HID hid)
        {
            var hnblock = heapNode.HeapNodes[(int)hid.hidBlockIndex];

            return(hnblock.GetAllocation(hid));
        }