コード例 #1
0
        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);
 }