Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
rosmon::Terminal::Parser Class Reference

Terminal escape sequence parser. More...

#include <terminal.h>

Public Member Functions

void apply (Terminal *term)
 Apply the current internal state (colors) on the terminal. More...
 
void parse (char c)
 parse single character c More...
 
void parse (const std::string &str)
 parse string More...
 
 Parser ()
 

Private Types

enum  State { STATE_ESCAPE, STATE_TYPE, STATE_CSI }
 

Private Member Functions

void parseSetAttributes (const std::string &str)
 

Private Attributes

int m_bgColor
 
bool m_bold
 
std::string m_buf
 
int m_fgColor
 
State m_state
 

Detailed Description

Terminal escape sequence parser.

This class allows the user to parse Linux escape sequences (restricted to simple color sequences for now).

Definition at line 58 of file terminal.h.

Member Enumeration Documentation

Enumerator
STATE_ESCAPE 
STATE_TYPE 
STATE_CSI 

Definition at line 74 of file terminal.h.

Constructor & Destructor Documentation

rosmon::Terminal::Parser::Parser ( )

Definition at line 26 of file terminal.cpp.

Member Function Documentation

void rosmon::Terminal::Parser::apply ( Terminal term)

Apply the current internal state (colors) on the terminal.

Definition at line 108 of file terminal.cpp.

void rosmon::Terminal::Parser::parse ( char  c)

parse single character c

Definition at line 69 of file terminal.cpp.

void rosmon::Terminal::Parser::parse ( const std::string &  str)

parse string

Definition at line 102 of file terminal.cpp.

void rosmon::Terminal::Parser::parseSetAttributes ( const std::string &  str)
private

Definition at line 34 of file terminal.cpp.

Member Data Documentation

int rosmon::Terminal::Parser::m_bgColor
private

Definition at line 85 of file terminal.h.

bool rosmon::Terminal::Parser::m_bold
private

Definition at line 86 of file terminal.h.

std::string rosmon::Terminal::Parser::m_buf
private

Definition at line 82 of file terminal.h.

int rosmon::Terminal::Parser::m_fgColor
private

Definition at line 84 of file terminal.h.

State rosmon::Terminal::Parser::m_state
private

Definition at line 81 of file terminal.h.


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


rosmon_core
Author(s): Max Schwarz
autogenerated on Wed Jul 10 2019 03:10:12