public ClassTypeInfo(IAnalyze analyze) : base(analyze)
        {
            TypeName = new LengthPrefixedString(analyze);
            Assert.IsMemberName(TypeName.Value);

            LibraryId = analyze.Reader.ReadInt32();
        }
Пример #2
0
        static public object GetBinaryTypeValue(IAnalyze analyze, BinaryTypeEnumeration binaryType)
        {
            object value = null;

            switch (binaryType)
            {
            case BinaryTypeEnumeration.Primitive:
                var temp = (PrimitiveTypeEnumeration)analyze.Reader.ReadByte();
                value = temp;

                if (temp == PrimitiveTypeEnumeration.String)
                {
                    throw new Exception();
                }
                break;

            case BinaryTypeEnumeration.SystemClass:
                //可能有问题
                value = new LengthPrefixedString(analyze);
                break;

            case BinaryTypeEnumeration.Class:
                value = new ClassTypeInfo(analyze);
                break;

            case BinaryTypeEnumeration.PrimitiveArray:
                value = (PrimitiveTypeEnumeration)analyze.Reader.ReadByte();
                break;
            }

            return(value);
        }
Пример #3
0
        public ClassInfo(IAnalyze analyze) : base(analyze)
        {
            ObjectId = analyze.Reader.ReadInt32();
            //暂时这么处理,ObjectId暂时应该不会大于该值
            Assert.IsObjectId(ObjectId);

            Name = new LengthPrefixedString(analyze);
            Assert.IsMemberName(Name.Value);

            MemberCount = analyze.Reader.ReadInt32();
            Assert.IsPositiveIntegerIncludeZero(MemberCount);

            MemberNames = new LengthPrefixedString[MemberCount];
            for (int i = 0; i < MemberCount; i++)
            {
                MemberNames[i] = new LengthPrefixedString(analyze);
                Assert.IsMemberName(MemberNames[i].Value);
            }
        }
Пример #4
0
 public StringValueWithCode(IAnalyze analyze) : base(analyze)
 {
     StringValue = new LengthPrefixedString(analyze);
 }