GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
PlainTextDecoder Class Reference

A terminal character decoder which produces plain text, ignoring colours and other appearance-related properties of the original characters. More...

#include "TerminalCharacterDecoder.h"

Inheritance diagram for PlainTextDecoder:
Collaboration diagram for PlainTextDecoder:

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ PlainTextDecoder()

PlainTextDecoder::PlainTextDecoder ( )

Definition at line 30 of file TerminalCharacterDecoder.cpp.

Member Function Documentation

◆ begin()

void PlainTextDecoder::begin ( QTextStream *  output)
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().

◆ decodeLine()

void PlainTextDecoder::decodeLine ( const Character *const  characters,
int  count,
LineProperty  properties 
)
virtual

Converts a line of terminal characters with associated properties into a text string and writes the string into an output QTextStream.

Parameters
charactersAn array of characters of length count.
propertiesAdditional properties which affect all characters in the line
outputThe 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().

◆ end()

void PlainTextDecoder::end ( )
virtual

◆ setTrailingWhitespace()

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().

◆ trailingWhitespace()

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.

Member Data Documentation

◆ _includeTrailingWhitespace

bool PlainTextDecoder::_includeTrailingWhitespace
private

◆ _output

QTextStream* PlainTextDecoder::_output
private

Definition at line 93 of file TerminalCharacterDecoder.h.

Referenced by begin(), decodeLine(), and end().


The documentation for this class was generated from the following files: