diff options
Diffstat (limited to 'sources/shiboken2/ApiExtractor/typedatabase.h')
-rw-r--r-- | sources/shiboken2/ApiExtractor/typedatabase.h | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/sources/shiboken2/ApiExtractor/typedatabase.h b/sources/shiboken2/ApiExtractor/typedatabase.h index 2e7b009c2..247d74362 100644 --- a/sources/shiboken2/ApiExtractor/typedatabase.h +++ b/sources/shiboken2/ApiExtractor/typedatabase.h @@ -54,13 +54,12 @@ struct TypeRejection; QT_FORWARD_DECLARE_CLASS(QDebug) -void setTypeRevision(TypeEntry* typeEntry, int revision); -int getTypeRevision(const TypeEntry* typeEntry); -int getTypeIndex(const TypeEntry* typeEntry); int getMaxTypeIndex(); class ContainerTypeEntry; class PrimitiveTypeEntry; +class TypeSystemTypeEntry; + class TypeDatabase { TypeDatabase(); @@ -91,12 +90,12 @@ public: NamespaceTypeEntry* findNamespaceType(const QString& name) const; ContainerTypeEntry* findContainerType(const QString& name) const; FunctionTypeEntry* findFunctionType(const QString& name) const; + const TypeSystemTypeEntry *findTypeSystemType(const QString &name) const; TypeEntry* findType(const QString& name) const; - TypeEntryHash allEntries() const { return m_entries; } - - SingleTypeEntryHash entries() const; + const TypeEntryMultiMap &entries() const { return m_entries; } + const TypedefEntryMap &typedefEntries() const { return m_typedefEntries; } PrimitiveTypeEntryList primitiveTypes() const; @@ -115,7 +114,7 @@ public: bool isReturnTypeRejected(const QString& className, const QString& typeName, QString *reason = nullptr) const; - void addType(TypeEntry* e); + bool addType(TypeEntry* e, QString *errorMessage = nullptr); FlagsTypeEntry* findFlagsType(const QString& name) const; void addFlagsType(FlagsTypeEntry* fte); @@ -147,9 +146,10 @@ public: bool parseFile(QIODevice* device, bool generate = true); - bool setApiVersion(const QString& package, const QString& version); + static bool setApiVersion(const QString& package, const QString& version); + static void clearApiVersions(); - bool checkApiVersion(const QString &package, const QVersionNumber &version) const; + static bool checkApiVersion(const QString &package, const QVersionNumber &version); bool hasDroppedTypeEntries() const { return !m_dropTypeEntries.isEmpty(); } @@ -163,12 +163,14 @@ public: void formatDebug(QDebug &d) const; #endif private: - TypeEntryList findTypes(const QString &name) const; + TypeEntryMultiMapConstIteratorRange findTypes(const QString &name) const; + TypeEntry *resolveTypeDefEntry(TypedefEntry *typedefEntry, QString *errorMessage); bool m_suppressWarnings; - TypeEntryHash m_entries; - SingleTypeEntryHash m_flagsEntries; - TemplateEntryHash m_templates; + TypeEntryMultiMap m_entries; + TypeEntryMap m_flagsEntries; + TypedefEntryMap m_typedefEntries; + TemplateEntryMap m_templates; QVector<QRegularExpression> m_suppressedWarnings; AddedFunctionList m_globalUserFunctions; |