21#include <quentier/utility/Linkage.h>
58[[nodiscard]] QString ToString(
const T &
object)
61 QTextStream strm(&str, QIODevice::WriteOnly);
66template <
class TKey,
class TValue>
67[[nodiscard]] QString ToString(
const QHash<TKey, TValue> &
object)
70 QTextStream strm(&str, QIODevice::WriteOnly);
71 strm << QStringLiteral(
"QHash: \n");
73 using CIter =
typename QHash<TKey, TValue>::const_iterator;
74 CIter hashEnd =
object.end();
75 for (CIter it =
object.begin(); it != hashEnd; ++it) {
76 strm << QStringLiteral(
"[") << it.key() << QStringLiteral(
"] = ")
77 << it.value() << QStringLiteral(
";\n");
83[[nodiscard]] QString ToString(
const QSet<T> &
object)
86 QTextStream strm(&str, QIODevice::WriteOnly);
87 strm << QStringLiteral(
"QSet: \n");
89 using CIter =
typename QSet<T>::const_iterator;
90 CIter setEnd =
object.end();
91 for (CIter it =
object.begin(); it != setEnd; ++it) {
92 strm << QStringLiteral(
"[") << *it << QStringLiteral(
"];\n");
97#define QUENTIER_DECLARE_PRINTABLE(type, ...) \
98 QUENTIER_EXPORT QTextStream & operator<<( \
99 QTextStream & strm, const type & obj); \
100 inline QDebug & operator<<(QDebug & debug, const type & obj) \
102 debug << ToString<type, ##__VA_ARGS__>(obj); \
The Printable class is the interface for Quentier's internal classes which should be able to write th...
Definition Printable.h:38
The Result template class represents the bare bones result monad implementation which either contains...
Definition Result.h:38