forked from qt-creator/qt-creator
AnsiEscapeHandler: Use a dedicated struct in favor of a qPair
Change-Id: I800d4868caf0cd58f83507ae2d0849d50f86a01f Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
@@ -37,13 +37,23 @@
|
||||
|
||||
namespace Utils {
|
||||
|
||||
typedef QPair<QString, QTextCharFormat> StringFormatPair;
|
||||
class QTCREATOR_UTILS_EXPORT FormattedText {
|
||||
public:
|
||||
FormattedText() { }
|
||||
FormattedText(const FormattedText &other) : text(other.text), format(other.format) { }
|
||||
FormattedText(const QString &txt, const QTextCharFormat &fmt = QTextCharFormat()) :
|
||||
text(txt), format(fmt)
|
||||
{ }
|
||||
|
||||
QString text;
|
||||
QTextCharFormat format;
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT AnsiEscapeCodeHandler
|
||||
{
|
||||
public:
|
||||
AnsiEscapeCodeHandler();
|
||||
QList<StringFormatPair> parseText(const QString &text, const QTextCharFormat &defaultFormat);
|
||||
QList<FormattedText> parseText(const FormattedText &input);
|
||||
void endFormatScope();
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user