Terminfo database entry. More...
#include <senf/Utils/Termlib/Terminfo.hh>
Classes | |
struct | InvalidTerminfoException |
Invalid, incomplete or non-existent terminfo entry exception. More... | |
struct | properties |
Terminfo property constants. More... | |
Public Types | |
enum | { NoValue = -1 } |
NoValue constant This value represents the absence of a numeric property value. More... | |
typedef boost::int16_t | number_t |
Numeric terminfo property type. More... | |
typedef char const * | string_t |
String terminfo property type. More... | |
Public Member Functions | |
Terminfo () | |
Terminfo (std::string const &term) | |
Load terminfo entry term. More... | |
void | load (std::string const &term) |
Load terminfo entry term. More... | |
bool | getFlag (properties::Boolean p) const |
Get boolean property value. More... | |
number_t | getNumber (properties::Numeric p) const |
Get numeric property value. More... | |
string_t | getString (properties::String p) const |
Get string property value. More... | |
bool | hasProperty (properties::Boolean p) const |
true , if boolean property p exists More... | |
bool | hasProperty (properties::Numeric p) const |
true , if numeric property p exists More... | |
bool | hasProperty (properties::String p) const |
true , if string property p exists More... | |
std::string | formatString (properties::String p, number_t arg1=NoValue, number_t arg2=NoValue, number_t arg3=NoValue, number_t arg4=NoValue, number_t arg5=NoValue, number_t arg6=NoValue, number_t arg7=NoValue, number_t arg8=NoValue, number_t arg9=NoValue) const |
Format string property value. More... | |
void | dump (std::ostream &os) const |
Dump a description of the terminfo entry. More... | |
Terminfo database entry.
This class reads a single terminfo database entry and allows to access the terminfo properties.
Definition at line 55 of file Terminfo.hh.
typedef boost::int16_t senf::term::Terminfo::number_t |
Numeric terminfo property type.
Definition at line 174 of file Terminfo.hh.
typedef char const* senf::term::Terminfo::string_t |
String terminfo property type.
Definition at line 175 of file Terminfo.hh.
anonymous enum |
NoValue constant This value represents the absence of a numeric property value.
Enumerator | |
---|---|
NoValue |
Definition at line 63 of file Terminfo.hh.
senf::term::Terminfo::Terminfo | ( | ) |
Definition at line 137 of file Terminfo.cc.
|
explicit |
Load terminfo entry term.
Definition at line 140 of file Terminfo.cc.
void senf::term::Terminfo::dump | ( | std::ostream & | os | ) | const |
Dump a description of the terminfo entry.
Definition at line 326 of file Terminfo.cc.
std::string senf::term::Terminfo::formatString | ( | properties::String | p, |
number_t | arg1 = NoValue , |
||
number_t | arg2 = NoValue , |
||
number_t | arg3 = NoValue , |
||
number_t | arg4 = NoValue , |
||
number_t | arg5 = NoValue , |
||
number_t | arg6 = NoValue , |
||
number_t | arg7 = NoValue , |
||
number_t | arg8 = NoValue , |
||
number_t | arg9 = NoValue |
||
) | const |
Format string property value.
Formats the string property p containing special terminfo codes. Terminfo supports up to 9 parameters.
Definition at line 235 of file Terminfo.cc.
bool senf::term::Terminfo::getFlag | ( | properties::Boolean | p | ) | const |
Get boolean property value.
Definition at line 159 of file Terminfo.cc.
senf::term::Terminfo::number_t senf::term::Terminfo::getNumber | ( | properties::Numeric | p | ) | const |
Get numeric property value.
Definition at line 167 of file Terminfo.cc.
senf::term::Terminfo::string_t senf::term::Terminfo::getString | ( | properties::String | p | ) | const |
Get string property value.
If the property does not exist, 0 is returned
Definition at line 175 of file Terminfo.cc.
bool senf::term::Terminfo::hasProperty | ( | properties::Boolean | p | ) | const |
true
, if boolean property p exists
Definition at line 183 of file Terminfo.cc.
bool senf::term::Terminfo::hasProperty | ( | properties::Numeric | p | ) | const |
true
, if numeric property p exists
Definition at line 189 of file Terminfo.cc.
bool senf::term::Terminfo::hasProperty | ( | properties::String | p | ) | const |
true
, if string property p exists
Definition at line 195 of file Terminfo.cc.
void senf::term::Terminfo::load | ( | std::string const & | term | ) |
Load terminfo entry term.
Definition at line 145 of file Terminfo.cc.