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:
Tobias Hunger
2014-01-17 15:55:27 +01:00
parent c96fd7411d
commit 7168dd48fe
5 changed files with 65 additions and 53 deletions

View File

@@ -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: