diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-06-01 11:20:14 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-06-01 18:32:55 +0000 |
commit | 7f798dfc9fc6e3e9756f06f0fedc821e16f1320a (patch) | |
tree | 661fcaf9bd38082dc950466bcc7e5a24620c5b1c /sources/shiboken2/ApiExtractor/parser/codemodel.cpp | |
parent | 4e468d77de10c7bd6e76b59a37cecb5151a80626 (diff) |
shiboken: Streamline the type parsing code
Replace struct TypeParser::Info by TypeInfo and remove
TypeParser::Info. Move method
TypeParser::Info::instantiationName() to TypeInfo
for this purpose.
Change TypeParser::parse() to return TypeInfo.
Task-number: QTBUG-672
Change-Id: I123d5bf378ad146867b571e47e31ae08a92b2504
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/parser/codemodel.cpp')
-rw-r--r-- | sources/shiboken2/ApiExtractor/parser/codemodel.cpp | 14 |
1 files changed, 14 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()) |