28 #include <QtCore/QTextStream>
32 , _includeTrailingWhitespace(true)
63 plainText.reserve(count);
65 int outputCount = count;
71 for (
int i = count-1 ; i >= 0 ; i--)
73 if ( characters[i].character !=
' ' )
80 for (
int i=0;i<outputCount;i++)
82 plainText.append( QChar(characters[i].character) );
91 ,_innerSpanOpen(false)
104 openSpan(text,
"font-family:monospace");
133 for (
int i=0;i<count;i++)
135 QChar ch(characters[i].character);
154 style.append(
"font-weight:bold;");
158 style.append(
"font-decoration:underline;");
196 text.append(
" ");
213 text.append( QString(
"<span style=\"%1\">").
arg(style) );
218 text.append(
"</span>");
An entry in a terminal display's color palette.
void closeSpan(QString &text)
const ColorEntry * _colorTable
static const ColorEntry base_color_table[(2 *(2+8))]
#define DEFAULT_RENDITION
A single character in the terminal which consists of a unicode character value, foreground and backgr...
bool trailingWhitespace() const
Returns whether trailing whitespace at the end of lines is included in the output.
quint8 rendition
A combination of RENDITION flags which specify options for drawing the character. ...
unsigned char LineProperty
void openSpan(QString &text, const QString &style)
CharacterColor backgroundColor
The color used to draw this character's background.
virtual void decodeLine(const Character *const characters, int count, LineProperty properties)
Converts a line of terminal characters with associated properties into a text string and writes the s...
CharacterColor _lastForeColor
virtual void decodeLine(const Character *const characters, int count, LineProperty properties)
Converts a line of terminal characters with associated properties into a text string and writes the s...
bool _includeTrailingWhitespace
CharacterColor foregroundColor
The foreground color used to draw this character.
QColor color(const ColorEntry *palette) const
Returns the color within the specified color .
virtual void end()
End decoding.
void setTrailingWhitespace(bool enable)
Set whether trailing whitespace at the end of lines should be included in the output.
virtual void end()
End decoding.
HTMLDecoder()
Constructs an HTML decoder using a default black-on-white color scheme.
virtual void begin(QTextStream *output)
Begin decoding characters.
CharacterColor _lastBackColor
virtual void begin(QTextStream *output)
Begin decoding characters.
void setColorTable(const ColorEntry *table)
Sets the colour table which the decoder uses to produce the HTML colour codes in its output...