diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-06-09 14:02:23 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-06-09 12:15:59 +0000 |
commit | a486c7b0cdf727de6aeb521d7ae571d1c443c9c4 (patch) | |
tree | 5245d0a951578b24855744e5dfd45d90879e0241 /tools | |
parent | bd5533b250ae4fb6a144fda69ead425740c61017 (diff) |
dumpcpp: Add Qt version and command line to header comment block.
produces:
/****************************************************************************
**
** Namespace TestLib generated by dumpcpp v5.5.0 using
** dumpcpp -o test Test.tlb
** from the type library Test.tlb
**
****************************************************************************/
Task-number: QTBUG-27792
Change-Id: I22ef45c424f07ae89e2cbae1d8c05686b0646c5c
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/dumpcpp/main.cpp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/tools/dumpcpp/main.cpp b/tools/dumpcpp/main.cpp index 691e723..1fbcaa8 100644 --- a/tools/dumpcpp/main.cpp +++ b/tools/dumpcpp/main.cpp @@ -893,6 +893,15 @@ void generateClassImpl(QTextStream &out, const QMetaObject *mo, const QByteArray out << '}' << endl; } +static void formatCommentBlockFooter(const QString &typeLibFile, QTextStream &str) +{ + str << " generated by dumpcpp v" << QT_VERSION_STR << " using\n**"; + foreach (const QString &arg, QCoreApplication::arguments()) + str << ' ' << arg; + str << "\n** from the type library " << typeLibFile << "\n**\n" + << "****************************************************************************/\n\n"; +} + bool generateTypeLibrary(QString typeLibFile, QString outname, const QString &nameSpace, ObjectCategory category) { @@ -947,13 +956,9 @@ bool generateTypeLibrary(QString typeLibFile, QString outname, return false; } - implOut << "/****************************************************************************" << endl; - implOut << "**" << endl; - implOut << "** Metadata for " << libName << " generated by dumpcpp from type library" << endl; - implOut << "** " << typeLibFile << endl; - implOut << "**" << endl; - implOut << "****************************************************************************/" << endl; - implOut << endl; + implOut << "/****************************************************************************\n" + "**\n** Metadata for " << libName; + formatCommentBlockFooter(typeLibFile, implOut); implOut << "#define QAX_DUMPCPP_" << libName.toUpper() << "_NOINLINES" << endl; @@ -978,13 +983,9 @@ bool generateTypeLibrary(QString typeLibFile, QString outname, return false; } - declOut << "/****************************************************************************" << endl; - declOut << "**" << endl; - declOut << "** Namespace " << libName << " generated by dumpcpp from type library" << endl; - declOut << "** " << typeLibFile << endl; - declOut << "**" << endl; - declOut << "****************************************************************************/" << endl; - declOut << endl; + declOut << "/****************************************************************************\n" + "**\n** Namespace " << libName; + formatCommentBlockFooter(typeLibFile, declOut); QFileInfo cppFileInfo(outname); writeHeader(declOut, libName, cppFileInfo.fileName()); |