terminal_tools Namespace Reference

Classes

class  TicToc

Enumerations

enum  TT_ATTIBUTES {
  TT_RESET = 0, TT_BRIGHT = 1, TT_DIM = 2, TT_UNDERLINE = 3,
  TT_BLINK = 4, TT_REVERSE = 7, TT_HIDDEN = 8
}
enum  TT_COLORS {
  TT_BLACK, TT_RED, TT_GREEN, TT_YELLOW,
  TT_BLUE, TT_MAGENTA, TT_CYAN, TT_WHITE
}

Functions

void change_text_color (FILE *stream, int attribute, int fg)
 Change the text color (on either stdout or stderr) with an attr:fg.
void change_text_color (FILE *stream, int attribute, int fg, int bg)
 Change the text color (on either stdout or stderr) with an attr:fg:bg.
int parse_2x_arguments (int argc, char **argv, const char *str, int &f, int &s, bool debug=true)
 Parse for specific given command line arguments (2x values comma separated). Returns the values sent as ints.
int parse_2x_arguments (int argc, char **argv, const char *str, double &f, double &s, bool debug=true)
 Parse for specific given command line arguments (2x values comma separated). Returns the values sent as doubles.
int parse_3x_arguments (int argc, char **argv, const char *str, int &f, int &s, int &t, bool debug=true)
 Parse for specific given command line arguments (3x values comma separated). Returns the values sent as ints.
int parse_3x_arguments (int argc, char **argv, const char *str, double &f, double &s, double &t, bool debug=true)
 Parse for specific given command line arguments (3x values comma separated). Returns the values sent as doubles.
int parse_argument (int argc, char **argv, const char *str, unsigned int &val)
 Parse for a specific given command line argument. Returns the value sent as an unsigned int.
int parse_argument (int argc, char **argv, const char *str, int &val)
 Parse for a specific given command line argument. Returns the value sent as an int.
int parse_argument (int argc, char **argv, const char *str, double &val)
 Parse for a specific given command line argument. Returns the value sent as a double.
int parse_argument (int argc, char **argv, const char *str, bool &val)
 Parse for a specific given command line argument. Returns the value sent as a boolean.
int parse_argument (int argc, char **argv, const char *str, std::string &val)
 Parse for a specific given command line argument. Returns the value sent as a string.
std::vector< int > parse_file_extension_argument (int argc, char **argv, const std::string &ext)
 Parse command line arguments for file names. Returns a vector with file names indices.
bool parse_multiple_2x_arguments (int argc, char **argv, const char *str, std::vector< double > &values_f, std::vector< double > &values_s)
 Parse for specific given command line arguments (multiple occurances of 2x argument groups, separated by commas). Returns 2 vectors holding the given values.
bool parse_multiple_3x_arguments (int argc, char **argv, const char *str, std::vector< double > &values_f, std::vector< double > &values_s, std::vector< double > &values_t)
 Parse for specific given command line arguments (multiple occurances of 3x argument groups, separated by commas). Returns 3 vectors holding the given values.
bool parse_multiple_arguments (int argc, char **argv, const char *str, std::vector< double > &values)
 Parse for specific given command line arguments (multiple occurances of the same command line parameter). Returns the values sent as a vector.
bool parse_multiple_arguments (int argc, char **argv, const char *str, std::vector< int > &values)
 Parse for specific given command line arguments (multiple occurances of the same command line parameter). Returns the values sent as a vector.
void print_color (FILE *stream, int attr, int fg, const char *format,...)
 Print a message on stream with colors.
void print_debug (FILE *stream, const char *format,...)
 Print a debug message on stream with colors.
void print_debug (const char *format,...)
 Print a debug message on stream with colors.
void print_error (FILE *stream, const char *format,...)
 Print an error message on stream with colors.
void print_error (const char *format,...)
 Print an error message on stream with colors.
void print_highlight (FILE *stream, const char *format,...)
 Print a highlighted info message on stream with colors.
void print_highlight (const char *format,...)
 Print a highlighted info message on stream with colors.
void print_info (FILE *stream, const char *format,...)
 Print an info message on stream with colors.
void print_info (const char *format,...)
 Print an info message on stream with colors.
void print_value (FILE *stream, const char *format,...)
 Print a value message on stream with colors.
void print_value (const char *format,...)
 Print a value message on stream with colors.
void print_warn (FILE *stream, const char *format,...)
 Print a warning message on stream with colors.
void print_warn (const char *format,...)
 Print a warning message on stream with colors.
void reset_text_color (FILE *stream)
 Reset the text color (on either stdout or stderr) to its original state.

Enumeration Type Documentation

Enumerator:
TT_RESET 
TT_BRIGHT 
TT_DIM 
TT_UNDERLINE 
TT_BLINK 
TT_REVERSE 
TT_HIDDEN 

Definition at line 45 of file print.h.

Enumerator:
TT_BLACK 
TT_RED 
TT_GREEN 
TT_YELLOW 
TT_BLUE 
TT_MAGENTA 
TT_CYAN 
TT_WHITE 

Definition at line 56 of file print.h.


Function Documentation

void terminal_tools::change_text_color ( FILE *  stream,
int  attribute,
int  fg 
)

Change the text color (on either stdout or stderr) with an attr:fg.

Parameters:
stream the output stream (stdout, stderr, etc)
attribute the text attribute
fg the foreground color

Definition at line 62 of file print.cpp.

void terminal_tools::change_text_color ( FILE *  stream,
int  attribute,
int  fg,
int  bg 
)

Change the text color (on either stdout or stderr) with an attr:fg:bg.

Parameters:
stream the output stream (stdout, stderr, etc)
attribute the text attribute
fg the foreground color
bg the background color

Definition at line 47 of file print.cpp.

int terminal_tools::parse_2x_arguments ( int  argc,
char **  argv,
const char *  str,
int &  f,
int &  s,
bool  debug = true 
)

Parse for specific given command line arguments (2x values comma separated). Returns the values sent as ints.

Parameters:
argc the number of command line arguments
argv the command line arguments
str the command line argument to search for
f the first output value
s the second output value

Definition at line 236 of file parse.cpp.

int terminal_tools::parse_2x_arguments ( int  argc,
char **  argv,
const char *  str,
double &  f,
double &  s,
bool  debug = true 
)

Parse for specific given command line arguments (2x values comma separated). Returns the values sent as doubles.

Parameters:
argc the number of command line arguments
argv the command line arguments
str the command line argument to search for
f the first output value
s the second output value

Definition at line 203 of file parse.cpp.

int terminal_tools::parse_3x_arguments ( int  argc,
char **  argv,
const char *  str,
int &  f,
int &  s,
int &  t,
bool  debug = true 
)

Parse for specific given command line arguments (3x values comma separated). Returns the values sent as ints.

Parameters:
argc the number of command line arguments
argv the command line arguments
str the command line argument to search for
f the first output value
s the second output value
t the third output value

Definition at line 305 of file parse.cpp.

int terminal_tools::parse_3x_arguments ( int  argc,
char **  argv,
const char *  str,
double &  f,
double &  s,
double &  t,
bool  debug = true 
)

Parse for specific given command line arguments (3x values comma separated). Returns the values sent as doubles.

Parameters:
argc the number of command line arguments
argv the command line arguments
str the command line argument to search for
f the first output value
s the second output value
t the third output value

Definition at line 270 of file parse.cpp.

int terminal_tools::parse_argument ( int  argc,
char **  argv,
const char *  str,
unsigned int &  val 
)

Parse for a specific given command line argument. Returns the value sent as an unsigned int.

Parameters:
argc the number of command line arguments
argv the command line arguments
str the string value to search for
val the resultant value

Definition at line 143 of file parse.cpp.

int terminal_tools::parse_argument ( int  argc,
char **  argv,
const char *  str,
int &  val 
)

Parse for a specific given command line argument. Returns the value sent as an int.

Parameters:
argc the number of command line arguments
argv the command line arguments
str the string value to search for
val the resultant value

Definition at line 120 of file parse.cpp.

int terminal_tools::parse_argument ( int  argc,
char **  argv,
const char *  str,
double &  val 
)

Parse for a specific given command line argument. Returns the value sent as a double.

Parameters:
argc the number of command line arguments
argv the command line arguments
str the string value to search for
val the resultant value

Definition at line 97 of file parse.cpp.

int terminal_tools::parse_argument ( int  argc,
char **  argv,
const char *  str,
bool &  val 
)

Parse for a specific given command line argument. Returns the value sent as a boolean.

Parameters:
argc the number of command line arguments
argv the command line arguments
str the string value to search for
val the resultant value

Definition at line 74 of file parse.cpp.

int terminal_tools::parse_argument ( int  argc,
char **  argv,
const char *  str,
std::string &  val 
)

Parse for a specific given command line argument. Returns the value sent as a string.

Parameters:
argc the number of command line arguments
argv the command line arguments
str the string value to search for
val the resultant value

Definition at line 51 of file parse.cpp.

std::vector< int > terminal_tools::parse_file_extension_argument ( int  argc,
char **  argv,
const std::string &  extension 
)

Parse command line arguments for file names. Returns a vector with file names indices.

Parameters:
argc the number of command line arguments
argv the command line arguments
extension to search for

Definition at line 165 of file parse.cpp.

bool terminal_tools::parse_multiple_2x_arguments ( int  argc,
char **  argv,
const char *  str,
std::vector< double > &  values_f,
std::vector< double > &  values_s 
)

Parse for specific given command line arguments (multiple occurances of 2x argument groups, separated by commas). Returns 2 vectors holding the given values.

Parameters:
argc the number of command line arguments
argv the command line arguments
str the command line argument to search for
values_f the first vector of output values
values_s the second vector of output values

Definition at line 392 of file parse.cpp.

bool terminal_tools::parse_multiple_3x_arguments ( int  argc,
char **  argv,
const char *  str,
std::vector< double > &  values_f,
std::vector< double > &  values_s,
std::vector< double > &  values_t 
)

Parse for specific given command line arguments (multiple occurances of 3x argument groups, separated by commas). Returns 3 vectors holding the given values.

Parameters:
argc the number of command line arguments
argv the command line arguments
str the command line argument to search for
values_f the first vector of output values
values_s the second vector of output values
values_t the third vector of output values

Definition at line 432 of file parse.cpp.

bool terminal_tools::parse_multiple_arguments ( int  argc,
char **  argv,
const char *  str,
std::vector< double > &  values 
)

Parse for specific given command line arguments (multiple occurances of the same command line parameter). Returns the values sent as a vector.

Parameters:
argc the number of command line arguments
argv the command line arguments
str the command line argument to search for
values the resultant output values

Definition at line 364 of file parse.cpp.

bool terminal_tools::parse_multiple_arguments ( int  argc,
char **  argv,
const char *  str,
std::vector< int > &  values 
)

Parse for specific given command line arguments (multiple occurances of the same command line parameter). Returns the values sent as a vector.

Parameters:
argc the number of command line arguments
argv the command line arguments
str the command line argument to search for
values the resultant output values

Definition at line 338 of file parse.cpp.

void terminal_tools::print_color ( FILE *  stream,
int  attr,
int  fg,
const char *  format,
  ... 
)

Print a message on stream with colors.

Parameters:
stream the output stream (stdout, stderr, etc)
attribute the text attribute
fg the foreground color
format the message

Definition at line 91 of file print.cpp.

void terminal_tools::print_debug ( FILE *  stream,
const char *  format,
  ... 
)

Print a debug message on stream with colors.

Print a value message on stream with colors.

Parameters:
stream the output stream (stdout, stderr, etc)
format the message

Definition at line 301 of file print.cpp.

void terminal_tools::print_debug ( const char *  format,
  ... 
)

Print a debug message on stream with colors.

Print a value message on stream with colors.

Parameters:
format the message

Definition at line 283 of file print.cpp.

void terminal_tools::print_error ( FILE *  stream,
const char *  format,
  ... 
)

Print an error message on stream with colors.

Parameters:
stream the output stream (stdout, stderr, etc)
format the message

Definition at line 196 of file print.cpp.

void terminal_tools::print_error ( const char *  format,
  ... 
)

Print an error message on stream with colors.

Parameters:
format the message

Definition at line 178 of file print.cpp.

void terminal_tools::print_highlight ( FILE *  stream,
const char *  format,
  ... 
)

Print a highlighted info message on stream with colors.

Parameters:
stream the output stream (stdout, stderr, etc)
format the message

Definition at line 160 of file print.cpp.

void terminal_tools::print_highlight ( const char *  format,
  ... 
)

Print a highlighted info message on stream with colors.

Parameters:
format the message

Definition at line 141 of file print.cpp.

void terminal_tools::print_info ( FILE *  stream,
const char *  format,
  ... 
)

Print an info message on stream with colors.

Parameters:
stream the output stream (stdout, stderr, etc)
format the message

Definition at line 125 of file print.cpp.

void terminal_tools::print_info ( const char *  format,
  ... 
)

Print an info message on stream with colors.

Parameters:
format the message

Definition at line 108 of file print.cpp.

void terminal_tools::print_value ( FILE *  stream,
const char *  format,
  ... 
)

Print a value message on stream with colors.

Parameters:
stream the output stream (stdout, stderr, etc)
format the message

Definition at line 266 of file print.cpp.

void terminal_tools::print_value ( const char *  format,
  ... 
)

Print a value message on stream with colors.

Parameters:
format the message

Definition at line 248 of file print.cpp.

void terminal_tools::print_warn ( FILE *  stream,
const char *  format,
  ... 
)

Print a warning message on stream with colors.

Parameters:
stream the output stream (stdout, stderr, etc)
format the message

Definition at line 231 of file print.cpp.

void terminal_tools::print_warn ( const char *  format,
  ... 
)

Print a warning message on stream with colors.

Parameters:
format the message

Definition at line 213 of file print.cpp.

void terminal_tools::reset_text_color ( FILE *  stream  ) 

Reset the text color (on either stdout or stderr) to its original state.

Parameters:
stream the output stream (stdout, stderr, etc)

Definition at line 75 of file print.cpp.

 All Classes Namespaces Files Functions Variables Enumerations Enumerator


terminal_tools
Author(s): Radu Bogdan Rusu
autogenerated on Fri Jan 11 09:58:56 2013