diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2016-11-23 16:21:45 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2016-11-23 16:02:07 +0000 |
commit | 6fa9b98c7d67b4ffd7d859ad54b8213675c0e4bb (patch) | |
tree | eb2e7986005ed03188e764a047b74e197bbb531d /tools/qscxmlc/scxmlcppdumper.cpp | |
parent | 30db0289dd354aec9cb0f81a2e6c71cbbc5aeb0c (diff) |
Drop the --no-c++11 parameter from qscxmlc
We don't support C++98 anymore, so this is useless.
Change-Id: Ie918567253af6d9309b601c7cfbc0205ec888048
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Diffstat (limited to 'tools/qscxmlc/scxmlcppdumper.cpp')
-rw-r--r-- | tools/qscxmlc/scxmlcppdumper.cpp | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/tools/qscxmlc/scxmlcppdumper.cpp b/tools/qscxmlc/scxmlcppdumper.cpp index 53988cf..b539e0d 100644 --- a/tools/qscxmlc/scxmlcppdumper.cpp +++ b/tools/qscxmlc/scxmlcppdumper.cpp @@ -143,28 +143,17 @@ static const char *headerStart = using namespace DocumentModel; -QString createContainer(const QString &baseType, const QString &elementType, - const QStringList &elements, bool useCxx11) +QString createContainer(const QStringList &elements) { QString result; - if (useCxx11) { - if (elements.isEmpty()) { - result += QStringLiteral("{}"); - } else { - result += QStringLiteral("{ ") + elements.join(QStringLiteral(", ")) + QStringLiteral(" }"); - } + if (elements.isEmpty()) { + result += QStringLiteral("{}"); } else { - result += QStringLiteral("%1< %2 >()").arg(baseType, elementType); - if (!elements.isEmpty()) { - result += QStringLiteral(" << ") + elements.join(QStringLiteral(" << ")); - } + result += QStringLiteral("{ ") + elements.join(QStringLiteral(", ")) + QStringLiteral(" }"); } return result; } -QString createVector(const QString &elementType, const QStringList &elements, bool useCxx11) -{ return createContainer(QStringLiteral("QVector"), elementType, elements, useCxx11); } - static void generateList(QString &out, std::function<QString(int)> next) { const int maxLineLength = 80; @@ -380,8 +369,7 @@ int createFactoryId(QStringList &factories, const QString &className, const QString &namespacePrefix, const QScxmlExecutableContent::InvokeInfo &invokeInfo, const QVector<QScxmlExecutableContent::StringId> &namelist, - const QVector<QScxmlExecutableContent::ParameterInfo> ¶meters, - bool useCxx11) + const QVector<QScxmlExecutableContent::ParameterInfo> ¶meters) { const int idx = factories.size(); @@ -405,8 +393,7 @@ int createFactoryId(QStringList &factories, const QString &className, for (auto name : namelist) { l.append(QString::number(name)); } - line += QStringLiteral("%1, ").arg( - createVector(QStringLiteral("QScxmlExecutableContent::StringId"), l, useCxx11)); + line += QStringLiteral("%1, ").arg(createContainer(l)); } { QStringList l; @@ -416,9 +403,7 @@ int createFactoryId(QStringList &factories, const QString &className, QString::number(parameter.expr), QString::number(parameter.location)); } - line += QStringLiteral("%1);").arg( - createVector(QStringLiteral("QScxmlExecutableContent::ParameterInfo"), l, - useCxx11)); + line += QStringLiteral("%1);").arg(createContainer(l)); } factories.append(line); @@ -464,7 +449,7 @@ void CppDumper::dump(TranslationUnit *unit) className = mangleIdentifier(classnameForDocument.value(content.data())); } return createFactoryId(factories[i], className, namespacePrefix, - invokeInfo, names, parameters, m_translationUnit->useCxx11); + invokeInfo, names, parameters); }); classNames.append(mangleIdentifier(classnameForDocument.value(doc))); } |