diff options
Diffstat (limited to 'sources/shiboken2/ApiExtractor/typesystem_p.h')
-rw-r--r-- | sources/shiboken2/ApiExtractor/typesystem_p.h | 115 |
1 files changed, 98 insertions, 17 deletions
diff --git a/sources/shiboken2/ApiExtractor/typesystem_p.h b/sources/shiboken2/ApiExtractor/typesystem_p.h index 882cf3fab..a617110d6 100644 --- a/sources/shiboken2/ApiExtractor/typesystem_p.h +++ b/sources/shiboken2/ApiExtractor/typesystem_p.h @@ -55,6 +55,7 @@ class StackElement FunctionTypeEntry = 0xb, CustomTypeEntry = 0xc, SmartPointerTypeEntry = 0xd, + TypedefTypeEntry = 0xe, TypeEntryMask = 0xf, // Documentation tags @@ -140,37 +141,117 @@ public: bool parse(QXmlStreamReader &reader); + QString errorString() const { return m_error; } + private: - bool startElement(const QStringRef& localName, const QXmlStreamAttributes& atts); - bool handleSmartPointerEntry(StackElement *element, - QHash<QString, QString> &attributes, - const QString &name, - const QVersionNumber &since); + bool startElement(const QXmlStreamReader &reader); + SmartPointerTypeEntry *parseSmartPointerEntry(const QXmlStreamReader &, + const QString &name, + const QVersionNumber &since, + QXmlStreamAttributes *attributes); bool endElement(const QStringRef& localName); template <class String> // QString/QStringRef bool characters(const String &ch); - void fetchAttributeValues(const QString &name, const QXmlStreamAttributes &atts, - QHash<QString, QString> *acceptedAttributes); bool importFileElement(const QXmlStreamAttributes &atts); - void addFlags(const QString &name, QString flagName, - const QHash<QString, QString> &attributes, - const QVersionNumber &since); + + void applyCommonAttributes(TypeEntry *type, QXmlStreamAttributes *attributes) const; + PrimitiveTypeEntry * + parsePrimitiveTypeEntry(const QXmlStreamReader &, const QString &name, + const QVersionNumber &since, QXmlStreamAttributes *); + ContainerTypeEntry * + parseContainerTypeEntry(const QXmlStreamReader &, const QString &name, + const QVersionNumber &since, QXmlStreamAttributes *); + EnumTypeEntry * + parseEnumTypeEntry(const QXmlStreamReader &, const QString &name, + const QVersionNumber &since, QXmlStreamAttributes *); + FlagsTypeEntry * + parseFlagsEntry(const QXmlStreamReader &, EnumTypeEntry *enumEntry, + const QString &name, QString flagName, + const QVersionNumber &since, QXmlStreamAttributes *); + ObjectTypeEntry * + parseInterfaceTypeEntry(const QXmlStreamReader &, const QString &name, + const QVersionNumber &since, QXmlStreamAttributes *); + ValueTypeEntry * + parseValueTypeEntry(const QXmlStreamReader &, const QString &name, + const QVersionNumber &since, QXmlStreamAttributes *); + FunctionTypeEntry * + parseFunctionTypeEntry(const QXmlStreamReader &, const QString &name, + const QVersionNumber &since, QXmlStreamAttributes *); + TypedefEntry * + parseTypedefEntry(const QXmlStreamReader &, const QString &name, + const QVersionNumber &since, QXmlStreamAttributes *); + void applyComplexTypeAttributes(const QXmlStreamReader &, ComplexTypeEntry *ctype, + QXmlStreamAttributes *) const; + bool parseRenameFunction(const QXmlStreamReader &, QString *name, + QXmlStreamAttributes *); + bool parseInjectDocumentation(const QXmlStreamReader &, QXmlStreamAttributes *); + bool parseModifyDocumentation(const QXmlStreamReader &, QXmlStreamAttributes *); + TypeSystemTypeEntry * + parseRootElement(const QXmlStreamReader &, const QVersionNumber &since, + QXmlStreamAttributes *); + bool loadTypesystem(const QXmlStreamReader &, QXmlStreamAttributes *); + bool parseRejectEnumValue(const QXmlStreamReader &, QXmlStreamAttributes *); + bool parseReplaceArgumentType(const QXmlStreamReader &, const StackElement &topElement, + QXmlStreamAttributes *); + bool parseCustomConversion(const QXmlStreamReader &, const StackElement &topElement, + QXmlStreamAttributes *); + bool parseAddConversion(const QXmlStreamReader &, const StackElement &topElement, + QXmlStreamAttributes *); + bool parseNativeToTarget(const QXmlStreamReader &, const StackElement &topElement, + QXmlStreamAttributes *attributes); + bool parseModifyArgument(const QXmlStreamReader &, const StackElement &topElement, + QXmlStreamAttributes *attributes); + bool parseNoNullPointer(const QXmlStreamReader &, const StackElement &topElement, + QXmlStreamAttributes *attributes); + bool parseDefineOwnership(const QXmlStreamReader &, const StackElement &topElement, + QXmlStreamAttributes *); + bool parseArgumentMap(const QXmlStreamReader &, const StackElement &topElement, + QXmlStreamAttributes *); + bool parseRemoval(const QXmlStreamReader &, const StackElement &topElement, + QXmlStreamAttributes *); + bool parseRename(const QXmlStreamReader &, StackElement::ElementType type, + const StackElement &topElement, QXmlStreamAttributes *); + bool parseModifyField(const QXmlStreamReader &, QXmlStreamAttributes *); + bool parseAddFunction(const QXmlStreamReader &, const StackElement &topElement, + QXmlStreamAttributes *); + bool parseModifyFunction(const QXmlStreamReader &, const StackElement &topElement, + QXmlStreamAttributes *); + bool parseReplaceDefaultExpression(const QXmlStreamReader &, + const StackElement &topElement, QXmlStreamAttributes *); + CustomFunction * + parseCustomMetaConstructor(const QXmlStreamReader &, + StackElement::ElementType type, + const StackElement &topElement, QXmlStreamAttributes *); + bool parseReferenceCount(const QXmlStreamReader &, const StackElement &topElement, + QXmlStreamAttributes *); + bool parseParentOwner(const QXmlStreamReader &, const StackElement &topElement, + QXmlStreamAttributes *); + bool readFileSnippet(QXmlStreamAttributes *attributes, CodeSnip *snip); + bool parseInjectCode(const QXmlStreamReader &, const StackElement &topElement, + StackElement* element, QXmlStreamAttributes *); + bool parseInclude(const QXmlStreamReader &, const StackElement &topElement, + TypeEntry *entry, QXmlStreamAttributes *); + TemplateInstance + *parseTemplateInstanceEnum(const QXmlStreamReader &, const StackElement &topElement, + QXmlStreamAttributes *); + bool parseReplace(const QXmlStreamReader &, const StackElement &topElement, + StackElement *element, QXmlStreamAttributes *); TypeDatabase* m_database; - StackElement* m_current; - StackElement* m_currentDroppedEntry; - int m_currentDroppedEntryDepth; - int m_ignoreDepth; + StackElement* m_current = nullptr; + StackElement* m_currentDroppedEntry = nullptr; + int m_currentDroppedEntryDepth = 0; + int m_ignoreDepth = 0; QString m_defaultPackage; QString m_defaultSuperclass; + TypeSystem::ExceptionHandling m_exceptionHandling = TypeSystem::ExceptionHandling::Unspecified; QString m_error; - TypeEntry::CodeGeneration m_generate; + const TypeEntry::CodeGeneration m_generate; - EnumTypeEntry* m_currentEnum; + EnumTypeEntry* m_currentEnum = nullptr; QStack<StackElementContext*> m_contextStack; - QHash<QString, StackElement::ElementType> tagNames; QString m_currentSignature; QString m_currentPath; }; |