ReadTypeInfo() static private method

static private ReadTypeInfo ( BinaryTypeEnum binaryTypeEnum, __BinaryParser input, int &assemId ) : Object
binaryTypeEnum BinaryTypeEnum
input __BinaryParser
assemId int
return Object
Esempio n. 1
0
 public void Read(__BinaryParser input)
 {
     this.objectId         = input.ReadInt32();
     this.name             = input.ReadString();
     this.numMembers       = input.ReadInt32();
     this.memberNames      = new string[this.numMembers];
     this.binaryTypeEnumA  = new BinaryTypeEnum[this.numMembers];
     this.typeInformationA = new object[this.numMembers];
     this.memberAssemIds   = new int[this.numMembers];
     for (int index = 0; index < this.numMembers; ++index)
     {
         this.memberNames[index] = input.ReadString();
     }
     for (int index = 0; index < this.numMembers; ++index)
     {
         this.binaryTypeEnumA[index] = (BinaryTypeEnum)input.ReadByte();
     }
     for (int index = 0; index < this.numMembers; ++index)
     {
         if (this.binaryTypeEnumA[index] != BinaryTypeEnum.ObjectUrt && this.binaryTypeEnumA[index] != BinaryTypeEnum.ObjectUser)
         {
             this.typeInformationA[index] = BinaryConverter.ReadTypeInfo(this.binaryTypeEnumA[index], input, out this.memberAssemIds[index]);
         }
         else
         {
             BinaryConverter.ReadTypeInfo(this.binaryTypeEnumA[index], input, out this.memberAssemIds[index]);
         }
     }
     if (this.binaryHeaderEnum != BinaryHeaderEnum.ObjectWithMapTypedAssemId)
     {
         return;
     }
     this.assemId = input.ReadInt32();
 }
 public void Read(__BinaryParser input)
 {
     this.objectId         = input.ReadInt32();
     this.name             = input.ReadString();
     this.numMembers       = input.ReadInt32();
     this.memberNames      = new string[this.numMembers];
     this.binaryTypeEnumA  = new BinaryTypeEnum[this.numMembers];
     this.typeInformationA = new object[this.numMembers];
     this.memberAssemIds   = new int[this.numMembers];
     for (int i = 0; i < this.numMembers; i++)
     {
         this.memberNames[i] = input.ReadString();
     }
     for (int j = 0; j < this.numMembers; j++)
     {
         this.binaryTypeEnumA[j] = (BinaryTypeEnum)input.ReadByte();
     }
     for (int k = 0; k < this.numMembers; k++)
     {
         if (this.binaryTypeEnumA[k] != BinaryTypeEnum.ObjectUrt && this.binaryTypeEnumA[k] != BinaryTypeEnum.ObjectUser)
         {
             this.typeInformationA[k] = BinaryConverter.ReadTypeInfo(this.binaryTypeEnumA[k], input, out this.memberAssemIds[k]);
         }
         else
         {
             BinaryConverter.ReadTypeInfo(this.binaryTypeEnumA[k], input, out this.memberAssemIds[k]);
         }
     }
     if (this.binaryHeaderEnum == BinaryHeaderEnum.ObjectWithMapTypedAssemId)
     {
         this.assemId = input.ReadInt32();
     }
 }
        public void Read(__BinaryParser input)
        {
            switch (this.binaryHeaderEnum)
            {
            case BinaryHeaderEnum.ArraySinglePrimitive:
                this.objectId            = input.ReadInt32();
                this.lengthA             = new int[1];
                this.lengthA[0]          = input.ReadInt32();
                this.binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
                this.rank            = 1;
                this.lowerBoundA     = new int[this.rank];
                this.binaryTypeEnum  = BinaryTypeEnum.Primitive;
                this.typeInformation = (InternalPrimitiveTypeE)input.ReadByte();
                return;

            case BinaryHeaderEnum.ArraySingleObject:
                this.objectId            = input.ReadInt32();
                this.lengthA             = new int[1];
                this.lengthA[0]          = input.ReadInt32();
                this.binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
                this.rank            = 1;
                this.lowerBoundA     = new int[this.rank];
                this.binaryTypeEnum  = BinaryTypeEnum.Object;
                this.typeInformation = null;
                return;

            case BinaryHeaderEnum.ArraySingleString:
                this.objectId            = input.ReadInt32();
                this.lengthA             = new int[1];
                this.lengthA[0]          = input.ReadInt32();
                this.binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
                this.rank            = 1;
                this.lowerBoundA     = new int[this.rank];
                this.binaryTypeEnum  = BinaryTypeEnum.String;
                this.typeInformation = null;
                return;

            default:
                this.objectId            = input.ReadInt32();
                this.binaryArrayTypeEnum = (BinaryArrayTypeEnum)input.ReadByte();
                this.rank        = input.ReadInt32();
                this.lengthA     = new int[this.rank];
                this.lowerBoundA = new int[this.rank];
                for (int i = 0; i < this.rank; i++)
                {
                    this.lengthA[i] = input.ReadInt32();
                }
                if (this.binaryArrayTypeEnum == BinaryArrayTypeEnum.SingleOffset || this.binaryArrayTypeEnum == BinaryArrayTypeEnum.JaggedOffset || this.binaryArrayTypeEnum == BinaryArrayTypeEnum.RectangularOffset)
                {
                    for (int j = 0; j < this.rank; j++)
                    {
                        this.lowerBoundA[j] = input.ReadInt32();
                    }
                }
                this.binaryTypeEnum  = (BinaryTypeEnum)input.ReadByte();
                this.typeInformation = BinaryConverter.ReadTypeInfo(this.binaryTypeEnum, input, out this.assemId);
                return;
            }
        }