Inheritance diagram for smtk::tty_color:

Public Member Functions | |
| const char * | bld (void) const |
| color bold | |
| const char * | blu (void) const |
| color blue | |
| bool | check_color (void) |
| check is escape colors are set | |
| const char * | end (void) const |
| color end | |
| void | get_env_color (FILE *file, bool over_ride_env=false) |
| parse environment variable SMTK_COLOR. | |
| const char * | grn (void) const |
| color green | |
| const char * | rblu (void) const |
| color reverse blue | |
| const char * | red (void) const |
| color red | |
| const char * | rev (void) const |
| color reverse | |
| const char * | rgrn (void) const |
| color reverse green | |
| const char * | rred (void) const |
| color reverse red | |
| const char * | rtur (void) const |
| color reverse turquoise | |
| const char * | rvil (void) const |
| color reverse violet | |
| const char * | ryel (void) const |
| color reverse yellow | |
| void | set_color (bool on=true) |
| enable/disable the escape color strings. | |
| tty_color (FILE *file=0, bool over_ride_env=false) | |
| const char * | tur (void) const |
| color turquoise | |
| const char * | und (void) const |
| color under line | |
| const char * | vil (void) const |
| color violet | |
| const char * | yel (void) const |
| color yellow | |
class tty_color tty_color.h smtk.h
The environment variable SMTK_COLOR affects the escape color sequences in the tty_color class. GNU `ls' uses a simular thing to colorize terminal text using the --color option. The following values of SMTK_COLOR can control the escape color sequences:
off or none on or always auto is the default. Will set the escape color sequences if the file is a terminal.
| tty_color::tty_color | ( | FILE * | file = 0, |
|
| bool | over_ride_env = false | |||
| ) |
| file | is used to check if the file is a tty terminal that will interpret the escape sequences. | |
| over_ride_env | if true the color strings will not depend on the environment variable SMTK_COLOR. |
| const char* smtk::tty_color::bld | ( | void | ) | const [inline] |
| const char* smtk::tty_color::blu | ( | void | ) | const [inline] |
| bool smtk::tty_color::check_color | ( | void | ) | [inline] |
check is escape colors are set
| const char* smtk::tty_color::end | ( | void | ) | const [inline] |
| void tty_color::get_env_color | ( | FILE * | file, | |
| bool | over_ride_env = false | |||
| ) |
parse environment variable SMTK_COLOR.
See color_env for how the environment variable SMTK_COLOR effects this class.
| file | is used to check if the file is a tty terminal that will interpret the escape sequences. | |
| over_ride_env | if true the color strings will not depend on the environment variable SMTK_COLOR. |
| const char* smtk::tty_color::grn | ( | void | ) | const [inline] |
| const char* smtk::tty_color::rblu | ( | void | ) | const [inline] |
| const char* smtk::tty_color::red | ( | void | ) | const [inline] |
| const char* smtk::tty_color::rev | ( | void | ) | const [inline] |
| const char* smtk::tty_color::rgrn | ( | void | ) | const [inline] |
| const char* smtk::tty_color::rred | ( | void | ) | const [inline] |
| const char* smtk::tty_color::rtur | ( | void | ) | const [inline] |
| const char* smtk::tty_color::rvil | ( | void | ) | const [inline] |
| const char* smtk::tty_color::ryel | ( | void | ) | const [inline] |
| void tty_color::set_color | ( | bool | on = true |
) |
enable/disable the escape color strings.
To give the API user the control, this is not called in any part of the SmTk API, other than in this class in the constructor. The setting of escape color strings is also set in the constructor from the value of the environment variable SMTK_COLOR. This will over-ride that. See color_env in the spew class detailed description.
| on | If on is true the escape color strings are set, and if on is false all the escape color strings are set to empty strings. |
Reimplemented in smtk::spew.
| const char* smtk::tty_color::tur | ( | void | ) | const [inline] |
| const char* smtk::tty_color::und | ( | void | ) | const [inline] |
| const char* smtk::tty_color::vil | ( | void | ) | const [inline] |
| const char* smtk::tty_color::yel | ( | void | ) | const [inline] |
1.5.2