Пример #1
0
 public ClassField(ClassField cf)
 {
     this._typeCode = cf._typeCode;
     this._name     = string.Copy(cf._name);
     _className1    = string.Copy(cf._className1);
     this._value    = null;
 }
        private void readClassDataField(ClassField cf)
        {
            print(cf.GetName());
            increaseIndent();
            var value = readFieldValue(cf.GetTypeCode());

            cf.SetValue(value);

            decreaseIndent();
        }
Пример #3
0
        // TODO
        //  return cdd or cd ??
        private object readNewArray()
        {
            var b1 = _bb.GetByte();

            print("TC_ARRAY - 0x" + string.Format("{0:X2}", b1));
            if (b1 != 0x75)
            {
                throw new Exception("Error: Illegal value for TC_ARRAY (should be 0x75)");
            }

            increaseIndent();

            ClassDataDesc cdd = readClassDesc();

            if (cdd.GetClassCount() != 1)
            {
                throw new Exception("Error: Array class description made up of more than one class.");
            }

            ClassDetails cd = cdd.GetClassDetails(0);

            if (cd.ClassName[0] != '[')
            {
                throw new Exception("Error: Array class name does not begin with '['.");
            }

            var handle = newHandle();

            _globalObjects[handle] = cdd;

            var size = _bb.GetInt32BE();

            print("Values");
            increaseIndent();

            for (int i = 0; i < size; i++)
            {
                print("Index " + i + ":");
                increaseIndent();

                var cf    = new ClassField((byte)cd.ClassName[1]);
                var value = readFieldValue(cf.GetTypeCode());
                cf.SetValue(value);
                cd.AddField(cf);
                decreaseIndent();
            }

            decreaseIndent();

            decreaseIndent();

            return(cd);
        }
 public void AddField(ClassField cf)
 {
     this._fieldDescriptions.Add(cf);
 }