109 # if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) 118 return isatty(m_out.
handle());
255 d->colorMapping = cMapping;
265 return d->colorMapping;
339 bool closureNeeded =
false;
344 closureNeeded =
true;
350 closureNeeded =
true;
353 finalMessage.
append(message);
static const char *const foregrounds[]
#define QT_END_NAMESPACE
This macro expands to.
static const char *const backgrounds[]
bool open(OpenMode flags)
Opens the file using OpenMode mode, returning true if successful; otherwise false.
void writeUncolored(const QString &message)
Writes message to stderr as if for instance QTextStream would have been used, and adds a line ending ...
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
bool contains(const Key &key) const
Returns true if the hash contains an item with the key; otherwise returns false.
The QChar class provides a 16-bit Unicode character.
const T value(const Key &key) const
Returns the value associated with the key.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
QString colorify(const QString &message, int color=-1) const
Treats message and colorID identically to write(), but instead of writing message to stderr...
void write(const QString &msg)
#define QT_BEGIN_NAMESPACE
This macro expands to.
void setColorMapping(const ColorMapping &cMapping)
Sets the color mapping to be cMapping.
static QString escapeCode(const QString &in)
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
The namespace for the internal API of QtXmlPatterns.
ColorOutput()
Constructs a ColorOutput instance, ready for use.
QByteArray toLocal8Bit() const Q_REQUIRED_RESULT
Returns the local 8-bit representation of the string as a QByteArray.
int handle() const
Returns the file handle of the file.
void insertMapping(int colorID, const ColorCode colorCode)
Adds a color mapping from colorID to colorCode, for this ColorOutput instance.
#define Q_ASSERT_X(cond, where, what)
bool isColoringPossible() const
Returns true if it's suitable to send colored output to stderr.
QString & append(QChar c)
The QFile class provides an interface for reading from and writing to files.
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
~ColorOutput()
Destructs this ColorOutput instance.
ColorMapping colorMapping() const
Returns the color mappings in use.
The QFlags class provides a type-safe way of storing OR-combinations of enum values.
ColorOutput::ColorMapping colorMapping
qint64 write(const char *data, qint64 len)
Writes at most maxSize bytes of data from data to the device.
#define qPrintable(string)
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
void write(const QString &message, int color=-1)
Sends message to stderr, using the color looked up in colorMapping() using colorID.