aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/typedatabase.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-11-22 13:25:01 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-11-24 11:37:48 +0000
commit0f5920b798af86454abbc2e466f96336920b4f1c (patch)
tree7f2e88751f4243634e1f8d39af6ac62c88072be9 /sources/shiboken2/ApiExtractor/typedatabase.cpp
parentb92fb6e81be252a2ffae26768434028c5029ddc7 (diff)
shiboken: Add debug output for function modifications
Task-number: PYSIDE-834 Change-Id: I2530b44f704ef96b784a77512f71777d9fd492bb Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/typedatabase.cpp')
-rw-r--r--sources/shiboken2/ApiExtractor/typedatabase.cpp29
1 files changed, 19 insertions, 10 deletions
diff --git a/sources/shiboken2/ApiExtractor/typedatabase.cpp b/sources/shiboken2/ApiExtractor/typedatabase.cpp
index 4cb6cdd8a..c0999e7ab 100644
--- a/sources/shiboken2/ApiExtractor/typedatabase.cpp
+++ b/sources/shiboken2/ApiExtractor/typedatabase.cpp
@@ -746,6 +746,20 @@ bool TypeDatabase::checkApiVersion(const QString &package,
if (!var.isEmpty()) \
d << ", " << var.size() << ' ' << name;
+template <class Container, class Separator>
+static void formatList(QDebug &d, const char *name, const Container &c, Separator sep)
+{
+ if (const int size = c.size()) {
+ d << ", " << name << '[' << size << "]=(";
+ for (int i = 0; i < size; ++i) {
+ if (i)
+ d << sep;
+ d << c.at(i);
+ }
+ d << ')';
+ }
+}
+
void TypeEntry::formatDebug(QDebug &d) const
{
const QString cppName = qualifiedCppName();
@@ -766,14 +780,7 @@ void TypeEntry::formatDebug(QDebug &d) const
d << ", sbkIndex=" << m_sbkIndex;
if (m_include.isValid())
d << ", include=" << m_include;
- if (const int count = m_extraIncludes.size()) {
- d << ", extraIncludes[" << count << "]=";
- for (int i = 0; i < count; ++i) {
- if (i)
- d << ", ";
- d << m_extraIncludes.at(i);
- }
- }
+ formatList(d, "extraIncludes", m_extraIncludes, ", ");
}
void ComplexTypeEntry::formatDebug(QDebug &d) const
@@ -794,7 +801,7 @@ void ComplexTypeEntry::formatDebug(QDebug &d) const
FORMAT_NONEMPTY_STRING("targetType", m_targetType)
FORMAT_NONEMPTY_STRING("hash", m_hashFunction)
FORMAT_LIST_SIZE("addedFunctions", m_addedFunctions)
- FORMAT_LIST_SIZE("functionMods", m_functionMods)
+ formatList(d, "functionMods", m_functionMods, ", ");
FORMAT_LIST_SIZE("fieldMods", m_fieldMods)
}
@@ -876,7 +883,9 @@ void TypeDatabase::formatDebug(QDebug &d) const
}
d << ")\n";
}
- d <<"\nglobalUserFunctions=" << m_globalUserFunctions << ')';
+ d <<"\nglobalUserFunctions=" << m_globalUserFunctions << '\n';
+ formatList(d, "globalFunctionMods", m_functionMods, '\n');
+ d << ')';
}
QDebug operator<<(QDebug d, const TypeDatabase &db)