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)
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>");
static const ColorEntry base_color_table[(2 *(2+8))]
unsigned char LineProperty
#define DEFAULT_RENDITION
QColor color(const ColorEntry *palette) const
Returns the color within the specified color @palette.
A single character in the terminal which consists of a unicode character value, foreground and backgr...
CharacterColor backgroundColor
The color used to draw this character's background.
CharacterColor foregroundColor
The foreground color used to draw this character.
quint8 rendition
A combination of RENDITION flags which specify options for drawing the character.
An entry in a terminal display's color palette.
CharacterColor _lastBackColor
CharacterColor _lastForeColor
HTMLDecoder()
Constructs an HTML decoder using a default black-on-white color scheme.
void closeSpan(QString &text)
const ColorEntry * _colorTable
virtual void end()
End decoding.
void openSpan(QString &text, const QString &style)
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...
void setColorTable(const ColorEntry *table)
Sets the colour table which the decoder uses to produce the HTML colour codes in its output.
virtual void begin(QTextStream *output)
Begin decoding characters.
void setTrailingWhitespace(bool enable)
Set whether trailing whitespace at the end of lines should be included in the output.
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...
virtual void begin(QTextStream *output)
Begin decoding characters.
bool _includeTrailingWhitespace
virtual void end()
End decoding.
bool trailingWhitespace() const
Returns whether trailing whitespace at the end of lines is included in the output.