![]() |
CopperSpice API
1.8.1
|
The QDebug class provides an output stream for debugging information. More...
Public Methods | |
QDebug (const QDebug &other) | |
QDebug (QIODevice *device) | |
QDebug (QString *string) | |
QDebug (QtMsgType type) | |
~QDebug () | |
bool | autoInsertSpaces () const |
QDebug & | maybeQuote (char c= '"') |
QDebug & | maybeSpace () |
QDebug & | noquote () |
QDebug & | nospace () |
QDebug & | operator<< (bool value) |
QDebug & | operator<< (char value) |
QDebug & | operator<< (char16_t value) |
QDebug & | operator<< (char32_t value) |
QDebug & | operator<< (const char *value) |
QDebug & | operator<< (const QByteArray &str) |
QDebug & | operator<< (const QString &str) |
QDebug & | operator<< (const void *ptr) |
QDebug & | operator<< (double value) |
QDebug & | operator<< (float value) |
QDebug & | operator<< (QChar value) |
QDebug & | operator<< (qint64 value) |
QDebug & | operator<< (QStringView str) |
QDebug & | operator<< (quint64 value) |
QDebug & | operator<< (signed int value) |
QDebug & | operator<< (signed long value) |
QDebug & | operator<< (signed short value) |
QDebug & | operator<< (unsigned int value) |
QDebug & | operator<< (unsigned long value) |
QDebug & | operator<< (unsigned short value) |
QDebug & | operator= (const QDebug &other) |
QDebug & | quote () |
QDebug & | resetFormat () |
void | setAutoInsertSpaces (bool b) |
void | setVerbosity (int verbosityLevel) |
QDebug & | space () |
void | swap (QDebug &other) |
int | verbosity () const |
The QDebug class provides an output stream for debugging information. QDebug is used whenever the developer needs to write out debugging or tracing information to a device, file, string or console.
In the common case, it is useful to call the qDebug() function to obtain a default QDebug object to use for writing debugging information.
This constructs a QDebug object using the constructor that accepts a QtMsgType value of QtDebugMsg. Similarly, the qWarning(), qCritical() and qFatal() functions also return QDebug objects for the corresponding message types.
The class also provides several constructors for other situations, including a constructor that accepts a QFile or any other QIODevice subclass that is used to write debugging information to files and other devices. The constructor that accepts a QString is used to write to a string for display or serialization.
Many standard types can be written to QDebug objects, and CopperSpice provides support for most CopperSpice value types. To add support for custom types, you need to implement a streaming operator, as in the following example.
This is described in Creating Custom Types.
|
inline |
Constructs a debug stream that writes to the given device.
|
inline |
Constructs a debug stream that writes to the given string.
|
inline |
Constructs a debug stream that writes to the handler for the message type specified by type.
|
inline |
Constructs a copy of the other debug stream.
QDebug::~QDebug | ( | ) |
Flushes any pending data to be written and destroys the debug stream.
|
inline |
Returns true if this QDebug instance will automatically insert spaces between writes.
|
inline |
|
inline |
|
inline |
Disables automatic insertion of quotation characters around QChar, QString and QByteArray contents. Returns a reference to the stream. When quoting is disabled these types are printed without quotation characters and without escaping of non-printable characters.
|
inline |
Disables automatic insertion of spaces. Returns a reference to the stream.
|
inline |
Writes the given boolean value to the stream and returns a reference to the stream.
|
inline |
Writes the character value to the stream and returns a reference to the stream.
|
inline |
Writes the 16-bit character value to the stream and returns a reference to the stream.
|
inline |
Writes the 32-bit character value to the stream and returns a reference to the stream.
|
inline |
Writes the null terminated string value to the stream and returns a reference to the stream.
|
inline |
Writes the byte array str to the stream and returns a reference to the stream.
|
inline |
Writes the string str to the stream and returns a reference to the stream.
|
inline |
Writes a pointer ptr to the stream and returns a reference to the stream.
|
inline |
Writes the 64-bit floating point number value to the stream and returns a reference to the stream.
|
inline |
Writes the 32-bit floating point number value to the stream and returns a reference to the stream.
|
inline |
Writes the character value to the stream and returns a reference to the stream.
|
inline |
Writes the signed 64-bit integer value to the stream and returns a reference to the stream.
|
inline |
Writes the string view str to the stream and returns a reference to the stream.
|
inline |
Writes the unsigned 64-bit integer value to the stream and returns a reference to the stream.
|
inline |
Writes the signed integer value to the stream and returns a reference to the stream.
|
inline |
Writes the signed long integer value to the stream and returns a reference to the stream.
|
inline |
Writes the signed short integer value to the stream and returns a reference to the stream.
|
inline |
Writes the unsigned integer value to the stream and returns a reference to the stream.
|
inline |
Writes the unsigned long integer value to the stream and returns a reference to the stream.
|
inline |
Writes the unsigned short integer value to the stream and returns a reference to the stream.
|
inline |
Copy assigns from other and returns a reference to this object.
|
inline |
Enables automatic insertion of quotation characters around QChar, QString and QByteArray contents and returns a reference to the stream.
Quoting is enabled by default.
QDebug & QDebug::resetFormat | ( | ) |
|
inline |
Enables automatic insertion of spaces between writes if b is true, otherwise automatic insertion of spaces is disabled.
|
inline |
Sets the verbosity of the stream to verbosityLevel. The allowed range is from 0 to 7. The default value is 2.
|
inline |
Writes a space character to the debug stream and returns a reference to the stream.
|
inline |
Swaps this debug stream instance with other. This method is very fast and never fails.
|
inline |
Returns the verbosity of the debug stream.
Streaming operators can check the value to decide whether verbose output is desired and print more information depending on the level. Higher values indicate that more information is desired. The allowed range is from 0 to 7. The default value is 2.