65 Stream(
QIODevice *device) : ts(device),
ref(1),
type(QtDebugMsg), space(
true), message_output(
false) {}
78 inline QDebug(QtMsgType
t) : stream(new Stream(t)) {}
79 inline QDebug(
const QDebug &o):stream(o.stream) { ++stream->ref; }
80 inline QDebug &operator=(
const QDebug &other);
83 if(stream->message_output) {
85 qt_message_output(stream->type, stream->buffer.toLocal8Bit().data());
86 } QT_CATCH(std::bad_alloc&) { }
91 inline QDebug &
space() { stream->
space =
true; stream->ts <<
' ';
return *
this; }
93 inline QDebug &
maybeSpace() {
if (stream->space) stream->ts <<
' ';
return *
this; }
95 inline QDebug &
operator<<(
QChar t) { stream->ts <<
'\'' << t <<
'\'';
return maybeSpace(); }
96 inline QDebug &
operator<<(QBool
t) { stream->ts << (bool(t != 0) ?
"true" :
"false");
return maybeSpace(); }
97 inline QDebug &
operator<<(
bool t) { stream->ts << (t ?
"true" :
"false");
return maybeSpace(); }
98 inline QDebug &
operator<<(
char t) { stream->ts <<
t;
return maybeSpace(); }
99 inline QDebug &
operator<<(
signed short t) { stream->ts <<
t;
return maybeSpace(); }
100 inline QDebug &
operator<<(
unsigned short t) { stream->ts <<
t;
return maybeSpace(); }
101 inline QDebug &
operator<<(
signed int t) { stream->ts <<
t;
return maybeSpace(); }
102 inline QDebug &
operator<<(
unsigned int t) { stream->ts <<
t;
return maybeSpace(); }
103 inline QDebug &
operator<<(
signed long t) { stream->ts <<
t;
return maybeSpace(); }
104 inline QDebug &
operator<<(
unsigned long t) { stream->ts <<
t;
return maybeSpace(); }
109 inline QDebug &
operator<<(
float t) { stream->ts <<
t;
return maybeSpace(); }
110 inline QDebug &
operator<<(
double t) { stream->ts <<
t;
return maybeSpace(); }
112 inline QDebug &
operator<<(
const QString &
t) { stream->ts <<
'\"' << t <<
'\"';
return maybeSpace(); }
116 inline QDebug &
operator<<(
const void *
t) { stream->ts <<
t;
return maybeSpace(); }
123 { stream->ts << m;
return *
this; }
132 #if !defined( QT_NO_TEXTSTREAM )
148 if (
this != &other) {
150 qSwap(stream, copy.stream);
155 #if defined(FORCE_UREF)
157 inline QDebug &operator<<(QDebug debug, const QList<T> &list)
170 return debug.
space();
173 #if defined(FORCE_UREF)
174 template <
typename T>
175 inline QDebug &operator<<(QDebug debug, const QVector<T> &vec)
177 template <typename T>
185 #if defined(FORCE_UREF)
186 template <
class aKey,
class aT>
187 inline QDebug &operator<<(QDebug debug, const QMap<aKey, aT> &
map)
189 template <class aKey, class aT>
196 debug <<
'(' << it.key() <<
", " << it.value() <<
')';
199 return debug.
space();
202 #if defined(FORCE_UREF)
203 template <
class aKey,
class aT>
204 inline QDebug &operator<<(QDebug debug, const QHash<aKey, aT> &hash)
206 template <class aKey, class aT>
213 debug <<
'(' << it.key() <<
", " << it.value() <<
')';
215 return debug.
space();
218 #if defined(FORCE_UREF)
219 template <
class T1,
class T2>
220 inline QDebug &operator<<(QDebug debug, const QPair<T1, T2> &pair)
222 template <class T1, class T2>
227 return debug.
space();
230 template <
typename T>
231 inline QDebug operator<<(QDebug debug, const QSet<T> &set)
237 #if defined(FORCE_UREF)
239 inline QDebug &operator<<(QDebug debug, const QContiguousCache<T> &cache)
245 debug.
nospace() <<
"QContiguousCache(";
248 if (i != cache.lastIndex())
252 return debug.
space();
255 #if defined(FORCE_UREF)
257 inline QDebug &operator<<(QDebug debug, const QFlags<T> &flags)
264 bool needSeparator =
false;
265 for (uint i = 0; i <
sizeof(T) * 8; ++i) {
266 if (flags.testFlag(T(1 << i))) {
270 needSeparator =
true;
275 return debug.
space();
278 #if !defined(QT_NO_DEBUG_STREAM)
281 #else // QT_NO_DEBUG_STREAM
284 #define qDebug QT_NO_QDEBUG_MACRO
288 #if !defined(QT_NO_WARNING_OUTPUT)
293 #define qWarning QT_NO_QWARNING_MACRO
GLuint GLuint GLsizei GLenum type
const_iterator constEnd() const
const_iterator constBegin() const
QDebug & operator<<(unsigned int t)
QDebug & operator<<(quint64 t)
QDebug operator<<(QDebug debug, const QList< T > &list)
QDebug & operator=(const QDebug &other)
QFuture< void > map(Sequence &sequence, MapFunctor map)
const char * latin1() const
QDebug & operator<<(unsigned short t)
static QString fromAscii(const char *, int size=-1)
QDebug & operator<<(signed long t)
QDebug & operator<<(unsigned long t)
unsigned long long quint64
Q_CORE_EXPORT_INLINE QDebug qWarning()
static QByteArray number(int, int base=10)
const char * constData() const
QDebug & operator<<(const QLatin1String &t)
#define QT_BEGIN_NAMESPACE
Q_INLINE_TEMPLATE void qSwap(QScopedPointer< T, Cleanup > &p1, QScopedPointer< T, Cleanup > &p2)
const T & at(int i) const
QDebug & operator<<(QChar t)
QDebug & operator<<(qint64 t)
QDebug(QIODevice *device)
QDebug & operator<<(char t)
QTextStream &(* QTextStreamFunction)(QTextStream &)
QList< T > toList() const
int count(const T &t) const
QDebug & operator<<(const char *t)
QDebug & operator<<(float t)
QDebug & operator<<(const QStringRef &t)
Q_CORE_EXPORT_INLINE QDebug qDebug()
static QString number(int, int base=10)
QDebug & operator<<(double t)
QDebug & operator<<(signed short t)
QDebug & operator<<(const QString &t)
QDebug & operator<<(const void *t)
QDebug & operator<<(signed int t)
Q_CORE_EXPORT_INLINE QDebug qCritical()
QDebug & operator<<(bool t)
QNoDebug & operator<<(QTextStreamFunction)
QDebug & operator<<(const QByteArray &t)
QNoDebug & operator<<(QTextStreamManipulator)
QNoDebug & operator<<(const T &)
const_iterator constBegin() const
const_iterator constEnd() const
QDebug & operator<<(QTextStreamFunction f)
QDebug & operator<<(QBool t)
QDebug & operator<<(QTextStreamManipulator m)