45 #include <QtCore/qalgorithms.h> 46 #include <QtCore/qhash.h> 47 #include <QtCore/qlist.h> 48 #include <QtCore/qmap.h> 49 #include <QtCore/qpair.h> 50 #include <QtCore/qtextstream.h> 51 #include <QtCore/qstring.h> 52 #include <QtCore/qvector.h> 53 #include <QtCore/qset.h> 54 #include <QtCore/qcontiguouscache.h> 80 inline QDebug &operator=(
const QDebug &other);
83 if(
stream->message_output) {
97 inline QDebug &
operator<<(
bool t) {
stream->ts << (t ?
"true" :
"false");
return maybeSpace(); }
123 {
stream->ts << m;
return *
this; }
132 #if !defined( QT_NO_TEXTSTREAM ) 148 if (
this != &other) {
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) {
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 static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
The QDebug class provides an output stream for debugging information.
static uint hash(const uchar *p, int n)
QString toString() const
Returns a copy of the string reference as a QString object.
#define Q_CORE_EXPORT_INLINE
The QContiguousCache class is a template class that provides a contiguous cache.
The QHash::const_iterator class provides an STL-style const iterator for QHash and QMultiHash...
#define QT_END_NAMESPACE
This macro expands to.
QList< T > toList() const
Returns a QList object with the data contained in this QVector.
static QString fromAscii(const char *, int size=-1)
Returns a QString initialized with the first size characters from the string str. ...
QDebug(QString *string)
Constructs a debug stream that writes to the given string.
QDebug & operator=(const QDebug &other)
Assigns the other debug stream to this stream and returns a reference to this stream.
QDebug & operator<<(signed long t)
Writes the signed long integer, l, to the stream and returns a reference to the stream.
#define it(className, varName)
QDebug operator<<(QDebug debug, const QList< T > &list)
Stream(QIODevice *device)
QDebug & operator<<(const QStringRef &t)
Writes the string reference, s, to the stream and returns a reference to the stream.
QDebug & nospace()
Clears the stream's internal flag that records whether the last character was a space and returns a r...
The QByteArray class provides an array of bytes.
QDebug & operator<<(const char *t)
Writes the '\0'-terminated string, s, to the stream and returns a reference to the stream...
~QDebug()
Flushes any pending data to be written and destroys the debug stream.
QDebug(QtMsgType t)
Constructs a debug stream that writes to the handler for the message type specified by type...
bool testFlag(Enum f) const
Returns true if the flag is set, otherwise false.
int count(const T &t) const
Returns the number of occurrences of value in the list.
QDebug & operator<<(double t)
Writes the 64-bit floating point number, f, to the stream and returns a reference to the stream...
The QString class provides a Unicode character string.
QDebug & operator<<(QChar t)
Writes the character, t, to the stream and returns a reference to the stream.
The QHash class is a template class that provides a hash-table-based dictionary.
static QList< QVariant > toList(char **buf, int count, T *=0)
The QVector class is a template class that provides a dynamic array.
QtMsgType
This enum describes the messages that can be sent to a message handler (QtMsgHandler).
The QChar class provides a 16-bit Unicode character.
Q_CORE_EXPORT_INLINE QDebug qWarning()
QDebug & operator<<(const void *t)
Writes a pointer, p, to the stream and returns a reference to the stream.
int size_type
Typedef for int.
QDebug(QIODevice *device)
Constructs a debug stream that writes to the given device.
QDebug & operator<<(float t)
Writes the 32-bit floating point number, f, to the stream and returns a reference to the stream...
QFuture< void > map(Sequence &sequence, MapFunction function)
#define QT_BEGIN_NAMESPACE
This macro expands to.
QNoDebug & operator<<(QTextStreamManipulator)
const char * latin1() const
Returns the Latin-1 string stored in this object.
QDebug & operator<<(bool t)
Writes the boolean value, t, to the stream and returns a reference to the stream. ...
QDebug & operator<<(char t)
Writes the character, t, to the stream and returns a reference to the stream.
const T & at(int i) const
Returns the item at index position i in the list.
QDebug & operator<<(unsigned long t)
Writes then unsigned long integer, l, to the stream and returns a reference to the stream...
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
QDebug & maybeSpace()
Writes a space character to the debug stream, depending on the last character sent to the stream...
QDebug & operator<<(QTextStreamFunction f)
int firstIndex() const
Returns the first valid index in the cache.
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the map.
QDebug & operator<<(QBool t)
Writes the boolean value, t, to the stream and returns a reference to the stream. ...
The QStringRef class provides a thin wrapper around QString substrings.
QDebug & operator<<(signed int t)
Writes the signed integer, i, to the stream and returns a reference to the stream.
void qSwap(T &value1, T &value2)
QTextStream &(* QTextStreamFunction)(QTextStream &)
const char * constData() const
Returns a pointer to the data stored in the byte array.
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the hash.
void qt_message_output(QtMsgType msgType, const char *buf)
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the hash...
The QMap::const_iterator class provides an STL-style const iterator for QMap and QMultiMap.
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the map...
The QTextStream class provides a convenient interface for reading and writing text.
QDebug & operator<<(qint64 t)
Writes the signed 64-bit integer, i, to the stream and returns a reference to the stream...
QNoDebug & operator<<(const T &)
struct QDebug::Stream * stream
Q_CORE_EXPORT_INLINE QDebug qDebug()
QDebug(const QDebug &o)
Constructs a copy of the other debug stream.
QDebug & operator<<(QTextStreamManipulator m)
QDebug & operator<<(const QByteArray &t)
Writes the byte array, b, to the stream and returns a reference to the stream.
QDebug & operator<<(const QString &t)
Writes the string, s, to the stream and returns a reference to the stream.
QDebug & operator<<(signed short t)
Writes the signed short integer, i, to the stream and returns a reference to the stream.
QDebug & operator<<(unsigned short t)
Writes then unsigned short integer, i, to the stream and returns a reference to the stream...
The QFlags class provides a type-safe way of storing OR-combinations of enum values.
Q_CORE_EXPORT_INLINE QDebug qCritical()
QDebug & operator<<(const QLatin1String &t)
Writes the Latin1-encoded string, s, to the stream and returns a reference to the stream...
QDebug & operator<<(quint64 t)
Writes then unsigned 64-bit integer, i, to the stream and returns a reference to the stream...
The QIODevice class is the base interface class of all I/O devices in Qt.
QDebug & space()
Writes a space character to the debug stream and returns a reference to the stream.
static QByteArray number(int, int base=10)
Returns a byte array containing the string equivalent of the number n to base base (10 by default)...
The QMap class is a template class that provides a skip-list-based dictionary.
QNoDebug & operator<<(QTextStreamFunction)
The QList class is a template class that provides lists.
int lastIndex() const
Returns the last valid index in the cache.
QDebug & operator<<(unsigned int t)
Writes then unsigned integer, i, to the stream and returns a reference to the stream.