aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Klöcker <[email protected]>2022-05-02 13:06:56 +0000
committerIngo Klöcker <[email protected]>2022-05-02 13:06:56 +0000
commit99fd565889f3d22459ff82296b206fa228a4c468 (patch)
tree8a57a4eac432b3e4f155fdc1e177efba9fd50fb3
parentqt: Factor out helper for getting the fingerprints of some keys (diff)
downloadgpgme-99fd565889f3d22459ff82296b206fa228a4c468.tar.gz
gpgme-99fd565889f3d22459ff82296b206fa228a4c468.zip
qt: Add debug helper for Result classes with output stream operator
* lang/qt/src/util.h (toLogString): New. -- GnuPG-bug-id: 5951
-rw-r--r--lang/qt/src/util.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lang/qt/src/util.h b/lang/qt/src/util.h
index c6aa87ce..6aba62e6 100644
--- a/lang/qt/src/util.h
+++ b/lang/qt/src/util.h
@@ -36,6 +36,7 @@
#include <gpgme.h>
+#include <sstream>
#include <string>
#include <vector>
@@ -55,4 +56,12 @@ std::vector<std::string> toStrings(const QStringList &l);
QStringList toFingerprints(const std::vector<GpgME::Key> &keys);
+template<class Result>
+std::string toLogString(const Result &result)
+{
+ std::stringstream stream;
+ stream << result;
+ return stream.str();
+}
+
#endif // __QGPGME_UTIL_H__