aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/clangparser/clangdebugutils.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-07-07 14:12:01 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-07-10 08:32:56 +0000
commit1bfd77c92d78c3861d0c09068e6c353020a510f4 (patch)
tree48ccb45110bd155df0884be01009b2d7c22fa220 /sources/shiboken2/ApiExtractor/clangparser/clangdebugutils.cpp
parentb49d3517e6b82eb40d7deff523cd127ba1348eb8 (diff)
shiboken2/clangparser: Use std::string_view for code snippet extraction
std: :string_view was added in C++ 17 and fits the purpose. Remove some outdated code for Clang < 5 on this occasion. Change-Id: I787f736679421c9080a6cabdef1616efb2c512e9 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/clangparser/clangdebugutils.cpp')
-rw-r--r--sources/shiboken2/ApiExtractor/clangparser/clangdebugutils.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/sources/shiboken2/ApiExtractor/clangparser/clangdebugutils.cpp b/sources/shiboken2/ApiExtractor/clangparser/clangdebugutils.cpp
index d6915daab..7123c22d8 100644
--- a/sources/shiboken2/ApiExtractor/clangparser/clangdebugutils.cpp
+++ b/sources/shiboken2/ApiExtractor/clangparser/clangdebugutils.cpp
@@ -147,4 +147,16 @@ QDebug operator<<(QDebug s, const CXSourceLocation &location)
return s;
}
+QDebug operator<<(QDebug s, const std::string_view &v)
+{
+ QDebugStateSaver saver(s);
+ s.nospace();
+ s.noquote();
+ s << '"';
+ for (auto c : v)
+ s << c;
+ s << '"';
+ return s;
+}
+
#endif // !QT_NO_DEBUG_STREAM