Esempio n. 1
0
        // Export exists in CppBuilder.ExportClassDefinitions
        public static HighMethod Read(TagRepository rpa, CatalogReader catalog, BinaryReader reader, TypeNameTag declaringClass)
        {
            bool isStatic = reader.ReadBoolean();
            MethodSignatureTag methodSignature = catalog.GetMethodSignature(reader.ReadUInt32());
            string name = catalog.GetString(reader.ReadUInt32());

            MethodDeclTag methodDeclTag = new MethodDeclTag(name, methodSignature, declaringClass);
            methodDeclTag = rpa.InternMethodDeclTag(methodDeclTag);

            bool isInternal = reader.ReadBoolean();
            HighMethodBody methodBody;

            if (isInternal)
                methodBody = null;
            else
                methodBody = HighMethodBody.Read(rpa, catalog, methodDeclTag, reader);

            return new HighMethod(isStatic, methodSignature, methodBody, methodDeclTag, isInternal);
        }
Esempio n. 2
0
        public CatalogReader(TagRepository rpa, BinaryReader reader)
        {
            uint numStrings = reader.ReadUInt32();
            m_strings = new string[numStrings];

            for (uint i = 0; i < numStrings; i++)
                m_strings[i] = reader.ReadString();

            uint numTypeNames = reader.ReadUInt32();
            m_typeNames = new List<TypeNameTag>();

            for (uint i = 0; i < numTypeNames; i++)
                m_typeNames.Add(rpa.InternTypeName(TypeNameTag.Read(this, reader)));

            uint numTypeSpecs = reader.ReadUInt32();
            m_typeSpecs = new List<TypeSpecTag>();

            for (uint i = 0; i < numTypeSpecs; i++)
                m_typeSpecs.Add(rpa.InternTypeSpec(TypeSpecTag.ReadVariant(this, reader)));

            uint numMethodSignatures = reader.ReadUInt32();
            m_methodSignatures = new MethodSignatureTag[numMethodSignatures];
            for (uint i = 0; i < numMethodSignatures; i++)
                m_methodSignatures[i] = rpa.InternMethodSignature(MethodSignatureTag.Read(this, reader));

            uint numVtableSlotTags = reader.ReadUInt32();
            m_methodDeclTags = new MethodDeclTag[numVtableSlotTags];

            for (uint i = 0; i < numVtableSlotTags; i++)
                m_methodDeclTags[i] = rpa.InternMethodDeclTag(MethodDeclTag.Read(this, reader));

            uint numMethodSpecs = reader.ReadUInt32();
            m_methodSpecs = new MethodSpecTag[numMethodSpecs];
            for (uint i = 0; i < numMethodSpecs; i++)
                m_methodSpecs[i] = rpa.InternMethodSpec(MethodSpecTag.Read(this, reader));

            m_assemblyName = GetString(reader.ReadUInt32());

            if (!rpa.RegisterAssembly(m_assemblyName))
                throw new Exception("Assembly registered multiple times");
        }