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 |
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.
|
private |
Enumerator | |
---|---|
STATE_ESCAPE | |
STATE_TYPE | |
STATE_CSI |
Definition at line 74 of file terminal.h.
rosmon::Terminal::Parser::Parser | ( | ) |
Definition at line 26 of file terminal.cpp.
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.
|
private |
Definition at line 34 of file terminal.cpp.
|
private |
Definition at line 85 of file terminal.h.
|
private |
Definition at line 86 of file terminal.h.
|
private |
Definition at line 82 of file terminal.h.
|
private |
Definition at line 84 of file terminal.h.
|
private |
Definition at line 81 of file terminal.h.