From 1bfd77c92d78c3861d0c09068e6c353020a510f4 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 7 Jul 2020 14:12:01 +0200 Subject: 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 --- .../shiboken2/ApiExtractor/clangparser/clangdebugutils.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'sources/shiboken2/ApiExtractor/clangparser/clangdebugutils.cpp') 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 -- cgit v1.2.3