diff options
Diffstat (limited to 'sources/shiboken2/ApiExtractor/parser')
-rw-r--r-- | sources/shiboken2/ApiExtractor/parser/codemodel.cpp | 14 | ||||
-rw-r--r-- | sources/shiboken2/ApiExtractor/parser/codemodel.h | 3 |
2 files changed, 17 insertions, 0 deletions
diff --git a/sources/shiboken2/ApiExtractor/parser/codemodel.cpp b/sources/shiboken2/ApiExtractor/parser/codemodel.cpp index 0af4905f4..60a699337 100644 --- a/sources/shiboken2/ApiExtractor/parser/codemodel.cpp +++ b/sources/shiboken2/ApiExtractor/parser/codemodel.cpp @@ -238,6 +238,20 @@ QString TypeInfo::toString() const return tmp; } +QStringList TypeInfo::instantiationName() const +{ + QStringList result = m_qualifiedName; + if (const int argumentCount = m_arguments.size()) { + QString &last = result.last(); + for (int i = 0; i < argumentCount; ++i) { + last += i ? QLatin1String(", ") : QLatin1String("< "); + last += m_arguments.at(i).toString(); + } + last += QLatin1String(" >"); + } + return result; +} + bool TypeInfo::operator==(const TypeInfo &other) const { if (arrayElements().count() != other.arrayElements().count()) diff --git a/sources/shiboken2/ApiExtractor/parser/codemodel.h b/sources/shiboken2/ApiExtractor/parser/codemodel.h index d0d7b677c..d93aa10d9 100644 --- a/sources/shiboken2/ApiExtractor/parser/codemodel.h +++ b/sources/shiboken2/ApiExtractor/parser/codemodel.h @@ -98,6 +98,7 @@ QDebug operator<<(QDebug d, const CodeModel *m); class TypeInfo { + friend class TypeParser; public: TypeInfo() : flags(0), m_referenceType(NoReference) {} @@ -184,6 +185,8 @@ public: QString toString() const; + QStringList instantiationName() const; + static TypeInfo combine(const TypeInfo &__lhs, const TypeInfo &__rhs); static TypeInfo resolveType(TypeInfo const &__type, CodeModelItem __scope); |