diff options
Diffstat (limited to 'sources/shiboken6/ApiExtractor/typedatabase.h')
-rw-r--r-- | sources/shiboken6/ApiExtractor/typedatabase.h | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/sources/shiboken6/ApiExtractor/typedatabase.h b/sources/shiboken6/ApiExtractor/typedatabase.h index 11ed26002..d5adca324 100644 --- a/sources/shiboken6/ApiExtractor/typedatabase.h +++ b/sources/shiboken6/ApiExtractor/typedatabase.h @@ -11,10 +11,13 @@ #include <QtCore/QRegularExpression> #include <QtCore/QStringList> #include <QtCore/QVersionNumber> -#include <QtCore/QSharedPointer> + +#include <memory> QT_FORWARD_DECLARE_CLASS(QIODevice) +struct OptionDescription; +class OptionsParser; struct TypeDatabasePrivate; struct TypeDatabaseParserContext; @@ -48,7 +51,9 @@ struct TypeRejection QRegularExpression className; QRegularExpression pattern; - MatchType matchType; + MatchType matchType = ExcludeClass; + bool generate; // Current type system + mutable bool matched = false; }; #ifndef QT_NO_DEBUG_STREAM @@ -58,10 +63,14 @@ QDebug operator<<(QDebug d, const TypeRejection &r); class TypeDatabase { TypeDatabase(); - Q_DISABLE_COPY(TypeDatabase) public: + Q_DISABLE_COPY_MOVE(TypeDatabase) + ~TypeDatabase(); + static QList<OptionDescription> options(); + std::shared_ptr<OptionsParser> createOptionsParser(); + /** * Return the type system instance. * \param newInstance This parameter is useful just for unit testing, because singletons causes @@ -76,15 +85,12 @@ public: void addRequiredTargetImport(const QString &moduleName); - void addTypesystemPath(const QString &typesystem_paths); - - void setTypesystemKeywords(const QStringList &keywords); QStringList typesystemKeywords() const; IncludeList extraIncludes(const QString &className) const; - const QStringList &systemIncludes() const; - void addSystemInclude(const QString &name); + const QStringList &forceProcessSystemIncludes() const; + void addForceProcessSystemInclude(const QString &name); void addInlineNamespaceLookups(const NamespaceTypeEntryCPtr &n); @@ -97,6 +103,7 @@ public: FunctionTypeEntryPtr findFunctionType(const QString &name) const; TypeSystemTypeEntryCPtr findTypeSystemType(const QString &name) const; TypeSystemTypeEntryCPtr defaultTypeSystemType() const; + QString loadedTypeSystemNames() const; QString defaultPackageName() const; TypeEntryPtr findType(const QString &name) const; @@ -135,7 +142,7 @@ public: const ComplexTypeEntryCPtr &source); FlagsTypeEntryPtr findFlagsType(const QString &name) const; - void addFlagsType(FlagsTypeEntryPtr fte); + void addFlagsType(const FlagsTypeEntryPtr &fte); TemplateEntryPtr findTemplate(const QString &name) const; @@ -153,9 +160,7 @@ public: FunctionModificationList globalFunctionModifications(const QStringList &signatures) const; - void setSuppressWarnings(bool on); - - bool addSuppressedWarning(const QString &warning, QString *errorMessage); + bool addSuppressedWarning(const QString &warning, bool generate, QString *errorMessage); bool isSuppressedWarning(QStringView s) const; @@ -163,12 +168,12 @@ public: // Top level file parsing bool parseFile(const QString &filename, bool generate = true); - bool parseFile(const QSharedPointer<TypeDatabaseParserContext> &context, + bool parseFile(const std::shared_ptr<TypeDatabaseParserContext> &context, const QString &filename, const QString ¤tPath, bool generate); // Top level QIODevice parsing for tests. bool parseFile(QIODevice *device, bool generate = true); - bool parseFile(const QSharedPointer<TypeDatabaseParserContext> &context, + bool parseFile(const std::shared_ptr<TypeDatabaseParserContext> &context, QIODevice *device, bool generate = true); static bool setApiVersion(const QString &package, const QString &version); @@ -180,10 +185,12 @@ public: bool shouldDropTypeEntry(const QString &fullTypeName) const; - void setDropTypeEntries(QStringList dropTypeEntries); + void setDropTypeEntries(const QStringList &dropTypeEntries); QString modifiedTypesystemFilepath(const QString &tsFile, const QString ¤tPath = QString()) const; + void logUnmatched() const; + #ifndef QT_NO_DEBUG_STREAM void formatDebug(QDebug &d) const; #endif |