A terminal character decoder which produces plain text, ignoring colours and other appearance-related properties of the original characters. More...
#include "TerminalCharacterDecoder.h"
Public Member Functions | |
PlainTextDecoder () | |
virtual void | begin (QTextStream *output) |
Begin decoding characters. More... | |
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 string into an output QTextStream. More... | |
virtual void | end () |
End decoding. More... | |
void | setTrailingWhitespace (bool enable) |
Set whether trailing whitespace at the end of lines should be included in the output. More... | |
bool | trailingWhitespace () const |
Returns whether trailing whitespace at the end of lines is included in the output. More... | |
Private Attributes | |
bool | _includeTrailingWhitespace |
QTextStream * | _output |
A terminal character decoder which produces plain text, ignoring colours and other appearance-related properties of the original characters.
Definition at line 67 of file TerminalCharacterDecoder.h.
PlainTextDecoder::PlainTextDecoder | ( | ) |
Definition at line 30 of file TerminalCharacterDecoder.cpp.
|
virtual |
Begin decoding characters.
The resulting text is appended to output
.
Implements TerminalCharacterDecoder.
Definition at line 44 of file TerminalCharacterDecoder.cpp.
References _output.
Referenced by TerminalView::inputMethodQuery(), Screen::selectedText(), and TerminalImageFilterChain::setImage().
|
virtual |
Converts a line of terminal characters with associated properties into a text string and writes the string into an output QTextStream.
characters | An array of characters of length count . |
properties | Additional properties which affect all characters in the line |
output | The output stream which receives the decoded text |
Implements TerminalCharacterDecoder.
Definition at line 52 of file TerminalCharacterDecoder.cpp.
References _includeTrailingWhitespace, and _output.
Referenced by TerminalView::inputMethodQuery(), and TerminalImageFilterChain::setImage().
|
virtual |
End decoding.
Implements TerminalCharacterDecoder.
Definition at line 48 of file TerminalCharacterDecoder.cpp.
References _output.
Referenced by TerminalView::inputMethodQuery(), Screen::selectedText(), and TerminalImageFilterChain::setImage().
void PlainTextDecoder::setTrailingWhitespace | ( | bool | enable | ) |
Set whether trailing whitespace at the end of lines should be included in the output.
Defaults to true.
Definition at line 36 of file TerminalCharacterDecoder.cpp.
References _includeTrailingWhitespace.
Referenced by TerminalImageFilterChain::setImage().
bool PlainTextDecoder::trailingWhitespace | ( | ) | const |
Returns whether trailing whitespace at the end of lines is included in the output.
Definition at line 40 of file TerminalCharacterDecoder.cpp.
References _includeTrailingWhitespace.
|
private |
Definition at line 94 of file TerminalCharacterDecoder.h.
Referenced by decodeLine(), setTrailingWhitespace(), and trailingWhitespace().
|
private |
Definition at line 93 of file TerminalCharacterDecoder.h.
Referenced by begin(), decodeLine(), and end().