Esempio n. 1
0
        public MetadataTables GetIndexType(CodedIndices index, int v)
        {
            int sz = this.GetTagSize(index);
            int vv = (v >> sz) << sz;

            return(CodedIndex.Data[(int)index][v - vv]);
        }
Esempio n. 2
0
        public int GetToken(CodedIndices index, int v)
        {
            int sz = this.GetTagSize(index);
            int vv = v >> sz;

            return((((int)CodedIndex.Data[(int)index][v - (vv << sz)]) << 24) | vv);
        }
Esempio n. 3
0
        protected string GetInfo(int v, CodedIndices index, string desc)
        {
            int           ad = this.ptr;
            StringBuilder sb = new StringBuilder();

            if (this.IndexManager.IsInt32(index))
            {
                sb.AppendFormat("{0:X8}", v);
                ptr += 4;
            }
            else
            {
                sb.AppendFormat("{0:X4}", v);
                ptr += 2;
            }
            if (v != 0)
            {
                MetadataTables tp   = this.IndexManager.GetIndexType(index, v);
                int            idx  = this.IndexManager.GetIndex(index, v);
                ArrayList      list = this.IndexManager.Tables[(int)tp];
                if (0 < idx && idx <= list.Count)
                {
                    sb.AppendFormat(" ({0})", (list[idx - 1] as TableBase).GetTitle());
                }
                else
                {
                    sb.AppendFormat(" ({0} {1:X} null)", tp, idx);
                }
            }
            while (sb.Length < 16)
            {
                sb.Append(' ');
            }
            return(string.Format("{0:X8}:{1} {2}\r\n", ad, sb, desc));
        }
Esempio n. 4
0
        public int GetTagSize(CodedIndices index)
        {
            int ret = 0;

            for (int i = CodedIndex.Data[(int)index].Length - 1; i > 0; i >>= 1)
            {
                ret++;
            }
            return(ret);
        }
Esempio n. 5
0
        public bool IsInt32(CodedIndices index)
        {
            int max = 0;

            foreach (MetadataTables tbl in CodedIndex.Data[(int)index])
            {
                int sz_tbl = this.TableRows[(int)tbl];
                if (max < sz_tbl)
                {
                    max = sz_tbl;
                }
            }
            return((max << this.GetTagSize(index)) > max16);
        }
Esempio n. 6
0
 public int GetIndex(CodedIndices index, int v)
 {
     return(v >> this.GetTagSize(index));
 }
Esempio n. 7
0
 public bool IsInt32(CodedIndices index)
 {
     int max = 0;
     foreach (MetadataTables tbl in CodedIndex.Data[(int) index])
     {
         int sz_tbl = this.TableRows[(int) tbl];
         if (max < sz_tbl) max = sz_tbl;
     }
     return (max << this.GetTagSize(index)) > max16;
 }
Esempio n. 8
0
 public int GetToken(CodedIndices index, int v)
 {
     int sz = this.GetTagSize(index);
     int vv = v >> sz;
     return (((int) CodedIndex.Data[(int) index][v -(vv << sz)]) << 24) | vv;
 }
Esempio n. 9
0
 public int GetTagSize(CodedIndices index)
 {
     int ret = 0;
     for (int i = CodedIndex.Data[(int) index].Length - 1; i > 0; i >>= 1) ret++;
     return ret;
 }
Esempio n. 10
0
 public MetadataTables GetIndexType(CodedIndices index, int v)
 {
     int sz = this.GetTagSize(index);
     int vv =(v >> sz) << sz;
     return CodedIndex.Data[(int) index][v - vv];
 }
Esempio n. 11
0
 public int GetIndex(CodedIndices index, int v)
 {
     return v >> this.GetTagSize(index);
 }
Esempio n. 12
0
 protected int ReadIndex(CodedIndices index)
 {
     return(this.IndexManager.IsInt32(index) ? this.ReadInt32():
            this.ReadInt16());
 }