6#include <QtCore/qfile.h>
7#include <QtCore/qhash.h>
24 m_coloringEnabled = isColoringPossible();
34 const ushort escapeChar = 0x1B;
57 int m_currentColorID = -1;
58 bool m_coloringEnabled =
false;
59 bool m_silent =
false;
64 inline bool isColoringPossible()
const
75 return isatty(m_out.
handle());
274 "It makes no sense to attempt to print an empty string.");
286 const int foregroundCode = (
color & ForegroundMask) >> ForegroundShift;
287 const int backgroundCode = (
color & BackgroundMask) >> BackgroundShift;
289 bool closureNeeded =
false;
291 if (foregroundCode > 0) {
295 closureNeeded =
true;
298 if (backgroundCode > 0) {
302 closureNeeded =
true;
constexpr bool isUpper() const noexcept
Returns true if the character is an uppercase letter, for example category() is Letter_Uppercase.
static const char *const foregrounds[]
static QString escapeCode(const QString &in)
bool coloringEnabled() const
void write(const QString &msg)
static const char *const backgrounds[]
void setSilent(bool silent)
bool containsColor(int id) const
void setCurrentColorID(int colorId)
void insertColor(int id, QColorOutput::ColorCode code)
QColorOutput::ColorCode color(int id) const
void setSilent(bool silent)
void write(const QStringView message, int color=-1)
void writePrefixedMessage(const QString &message, QtMsgType type, const QString &prefix=QString())
void insertMapping(int colorID, ColorCode colorCode)
void writeUncolored(const QString &message)
QString colorify(QStringView message, int color=-1) const
int handle() const
Returns the file handle of the file.
bool open(OpenMode flags) override
Opens the file using OpenMode mode, returning true if successful; otherwise false.
bool contains(const Key &key) const noexcept
Returns true if the hash contains an item with the key; otherwise returns false.
T value(const Key &key) const noexcept
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
qint64 write(const char *data, qint64 len)
Writes at most maxSize bytes of data from data to the device.
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QByteArray toLocal8Bit() const &
QString & append(QChar c)
Combined button and popup list for selecting options.
GLuint GLsizei const GLchar * message
#define Q_ASSERT_X(cond, x, msg)
#define qPrintable(string)
QLatin1StringView QLatin1String
#define QStringLiteral(str)
\inmodule QtCore \reentrant