Ejemplo n.º 1
0
 public Dictionary(EndianBinaryReader er)
 {
     revision    = er.ReadByte();
     numEntry    = er.ReadByte();
     sizeDictBlk = er.ReadUInt16();
     er.ReadBytes(2);            //PADDING(2 bytes);
     ofsEntry = er.ReadUInt16();
     node     = new PtreeNode[numEntry + 1];
     for (int i = 0; i < numEntry + 1; i++)
     {
         node[i]          = new PtreeNode();
         node[i].refBit   = er.ReadByte();
         node[i].idxLeft  = er.ReadByte();
         node[i].idxRight = er.ReadByte();
         node[i].idxEntry = er.ReadByte();
     }
     entry          = new DictEntry();
     entry.sizeUnit = er.ReadUInt16();
     entry.ofsName  = er.ReadUInt16();
     entry.data     = new List <T>();       //[numEntry];
     for (int i = 0; i < numEntry; i++)
     {
         entry.data.Add(new T());
         //entry.data[i] = new T();
         entry.data[i].Read(er);
     }
     names = new List <DictName>();           //[numEntry];
     for (int i = 0; i < numEntry; i++)
     {
         //names[i] = new DictName();
         names.Add(er.ReadString(ASCIIEncoding.ASCII, 0x10).Replace("\0", ""));
     }
 }
Ejemplo n.º 2
0
            public PtreeNode[] GetRawNodes()
            {
                List <PtreeNode> RawNodes = new List <PtreeNode>();

                foreach (PatTreeNode n in Nodes)
                {
                    PtreeNode node = new PtreeNode();
                    node.refBit   = (byte)n.refbit;
                    node.idxLeft  = (byte)Nodes.IndexOf(n.left);
                    node.idxRight = (byte)Nodes.IndexOf(n.right);
                    node.idxEntry = (byte)n.idxEntry;
                    RawNodes.Add(node);
                }
                return(RawNodes.ToArray());
            }