diff options
Diffstat (limited to 'sources/shiboken6/ApiExtractor')
-rw-r--r-- | sources/shiboken6/ApiExtractor/messages.cpp | 6 | ||||
-rw-r--r-- | sources/shiboken6/ApiExtractor/messages.h | 2 | ||||
-rw-r--r-- | sources/shiboken6/ApiExtractor/typesystem.cpp | 26 | ||||
-rw-r--r-- | sources/shiboken6/ApiExtractor/typesystem.h | 5 | ||||
-rw-r--r-- | sources/shiboken6/ApiExtractor/typesystemparser.cpp | 8 |
5 files changed, 47 insertions, 0 deletions
diff --git a/sources/shiboken6/ApiExtractor/messages.cpp b/sources/shiboken6/ApiExtractor/messages.cpp index 605b99966..762630fad 100644 --- a/sources/shiboken6/ApiExtractor/messages.cpp +++ b/sources/shiboken6/ApiExtractor/messages.cpp @@ -615,6 +615,12 @@ QString msgCannotFindSmartPointer(const QString &instantiationType, return result; } +QString msgMethodNotFound(const AbstractMetaClass *klass, const QString &name) +{ + return u"Method \""_qs + name + u"\" not found in class "_qs + + klass->name() + u'.'; +} + // main.cpp QString msgLeftOverArguments(const QVariantMap &remainingArgs) diff --git a/sources/shiboken6/ApiExtractor/messages.h b/sources/shiboken6/ApiExtractor/messages.h index 686c0efd7..11da21c8e 100644 --- a/sources/shiboken6/ApiExtractor/messages.h +++ b/sources/shiboken6/ApiExtractor/messages.h @@ -191,6 +191,8 @@ QString msgConversionTypesDiffer(const QString &varType, const QString &conversi QString msgCannotFindSmartPointer(const QString &instantiationType, const AbstractMetaClassCList &pointers); +QString msgMethodNotFound(const AbstractMetaClass *klass, const QString &name); + QString msgLeftOverArguments(const QVariantMap &remainingArgs); QString msgInvalidVersion(const QString &package, const QString &version); diff --git a/sources/shiboken6/ApiExtractor/typesystem.cpp b/sources/shiboken6/ApiExtractor/typesystem.cpp index 6ad87a736..e88022e80 100644 --- a/sources/shiboken6/ApiExtractor/typesystem.cpp +++ b/sources/shiboken6/ApiExtractor/typesystem.cpp @@ -1759,6 +1759,8 @@ public: QString m_getterName; QString m_smartPointerType; QString m_refCountMethodName; + QString m_nullCheckMethod; + QString m_resetMethod; SmartPointerTypeEntry::Instantiations m_instantiations; }; @@ -1784,6 +1786,30 @@ QString SmartPointerTypeEntry::refCountMethodName() const return d->m_refCountMethodName; } +QString SmartPointerTypeEntry::nullCheckMethod() const +{ + S_D(const SmartPointerTypeEntry); + return d->m_nullCheckMethod; +} + +void SmartPointerTypeEntry::setNullCheckMethod(const QString &f) +{ + S_D(SmartPointerTypeEntry); + d->m_nullCheckMethod = f; +} + +QString SmartPointerTypeEntry::resetMethod() const +{ + S_D(const SmartPointerTypeEntry); + return d->m_resetMethod; +} + +void SmartPointerTypeEntry::setResetMethod(const QString &f) +{ + S_D(SmartPointerTypeEntry); + d->m_resetMethod = f; +} + TypeEntry *SmartPointerTypeEntry::clone() const { S_D(const SmartPointerTypeEntry); diff --git a/sources/shiboken6/ApiExtractor/typesystem.h b/sources/shiboken6/ApiExtractor/typesystem.h index fc77fc6ca..f80ff886d 100644 --- a/sources/shiboken6/ApiExtractor/typesystem.h +++ b/sources/shiboken6/ApiExtractor/typesystem.h @@ -718,6 +718,11 @@ public: QString refCountMethodName() const; + QString nullCheckMethod() const; + void setNullCheckMethod(const QString &); + QString resetMethod() const; + void setResetMethod(const QString &); + TypeEntry *clone() const override; Instantiations instantiations() const; diff --git a/sources/shiboken6/ApiExtractor/typesystemparser.cpp b/sources/shiboken6/ApiExtractor/typesystemparser.cpp index a3730ef29..efce5ae90 100644 --- a/sources/shiboken6/ApiExtractor/typesystemparser.cpp +++ b/sources/shiboken6/ApiExtractor/typesystemparser.cpp @@ -1276,6 +1276,8 @@ SmartPointerTypeEntry * QString smartPointerType; QString getter; QString refCountMethodName; + QString nullCheckMethod; + QString resetMethod; QString instantiations; for (int i = attributes->size() - 1; i >= 0; --i) { const auto name = attributes->at(i).qualifiedName(); @@ -1287,6 +1289,10 @@ SmartPointerTypeEntry * refCountMethodName = attributes->takeAt(i).value().toString(); } else if (name == QLatin1String("instantiations")) { instantiations = attributes->takeAt(i).value().toString(); + } else if (name == u"null-check-method") { + nullCheckMethod = attributes->takeAt(i).value().toString(); + } else if (name == u"reset-method") { + resetMethod = attributes->takeAt(i).value().toString(); } } @@ -1322,6 +1328,8 @@ SmartPointerTypeEntry * refCountMethodName, since, currentParentTypeEntry()); if (!applyCommonAttributes(reader, type, attributes)) return nullptr; + type->setNullCheckMethod(nullCheckMethod); + type->setResetMethod(resetMethod); m_smartPointerInstantiations.insert(type, instantiations); return type; } |