Classes | Enumerations | Functions

pcl::console 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
}
enum  VERBOSITY_LEVEL {
  L_ALWAYS, L_ERROR, L_WARN, L_INFO,
  L_DEBUG, L_VERBOSE
}

Functions

PCL_EXPORTS int find_argument (int argc, char **argv, const char *argument_name)
 finds the position of the argument with name "argument_name" in the argument list "argv"
template<typename Type >
int parse (int argc, char **argv, const char *argument_name, Type &value)
 template version for parsing arguments.
PCL_EXPORTS int parse_argument (int argc, char **argv, const char *str, std::string &val)
 Parse for a specific given command line argument.
PCL_EXPORTS int parse_argument (int argc, char **argv, const char *str, bool &val)
 Parse for a specific given command line argument.
PCL_EXPORTS int parse_argument (int argc, char **argv, const char *str, double &val)
 Parse for a specific given command line argument.
PCL_EXPORTS int parse_argument (int argc, char **argv, const char *str, int &val)
 Parse for a specific given command line argument.
PCL_EXPORTS int parse_argument (int argc, char **argv, const char *str, unsigned int &val)
 Parse for a specific given command line argument.
PCL_EXPORTS 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).
PCL_EXPORTS 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).
PCL_EXPORTS 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).
PCL_EXPORTS 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).
PCL_EXPORTS 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).
PCL_EXPORTS 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).
PCL_EXPORTS bool parse_multiple_arguments (int argc, char **argv, const char *str, std::vector< std::string > &values)
 Parse for a specific given command line argument (multiple occurences of the same command line parameter).
PCL_EXPORTS 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).
PCL_EXPORTS 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).
PCL_EXPORTS std::vector< int > parse_file_extension_argument (int argc, char **argv, const std::string &ext)
 Parse command line arguments for file names.
PCL_EXPORTS void setVerbosityLevel (VERBOSITY_LEVEL level)
 set the verbosity level
PCL_EXPORTS VERBOSITY_LEVEL getVerbosityLevel ()
 get the verbosity level.
PCL_EXPORTS bool initVerbosityLevel ()
 initialize verbosity level.
PCL_EXPORTS bool isVerbosityLevelEnabled (VERBOSITY_LEVEL severity)
 is verbosity level enabled?
PCL_EXPORTS 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.
PCL_EXPORTS void change_text_color (FILE *stream, int attribute, int fg)
 Change the text color (on either stdout or stderr) with an attr:fg.
PCL_EXPORTS void reset_text_color (FILE *stream)
 Reset the text color (on either stdout or stderr) to its original state.
PCL_EXPORTS void print_color (FILE *stream, int attr, int fg, const char *format,...)
 Print a message on stream with colors.
PCL_EXPORTS void print_info (const char *format,...)
 Print an info message on stream with colors.
PCL_EXPORTS void print_info (FILE *stream, const char *format,...)
 Print an info message on stream with colors.
PCL_EXPORTS void print_highlight (const char *format,...)
 Print a highlighted info message on stream with colors.
PCL_EXPORTS void print_highlight (FILE *stream, const char *format,...)
 Print a highlighted info message on stream with colors.
PCL_EXPORTS void print_error (const char *format,...)
 Print an error message on stream with colors.
PCL_EXPORTS void print_error (FILE *stream, const char *format,...)
 Print an error message on stream with colors.
PCL_EXPORTS void print_warn (const char *format,...)
 Print a warning message on stream with colors.
PCL_EXPORTS void print_warn (FILE *stream, const char *format,...)
 Print a warning message on stream with colors.
PCL_EXPORTS void print_debug (const char *format,...)
 Print a debug message on stream with colors.
PCL_EXPORTS void print_debug (FILE *stream, const char *format,...)
 Print a debug message on stream with colors.
PCL_EXPORTS void print_value (const char *format,...)
 Print a value message on stream with colors.
PCL_EXPORTS void print_value (FILE *stream, const char *format,...)
 Print a value message on stream with colors.
PCL_EXPORTS void print (VERBOSITY_LEVEL level, FILE *stream, const char *format,...)
 Print a message on stream.
PCL_EXPORTS void print (VERBOSITY_LEVEL level, const char *format,...)
 Print a message.

Enumeration Type Documentation

Enumerator:
TT_RESET 
TT_BRIGHT 
TT_DIM 
TT_UNDERLINE 
TT_BLINK 
TT_REVERSE 
TT_HIDDEN 

Definition at line 56 of file print.h.

Enumerator:
TT_BLACK 
TT_RED 
TT_GREEN 
TT_YELLOW 
TT_BLUE 
TT_MAGENTA 
TT_CYAN 
TT_WHITE 

Definition at line 67 of file print.h.

Enumerator:
L_ALWAYS 
L_ERROR 
L_WARN 
L_INFO 
L_DEBUG 
L_VERBOSE 

Definition at line 79 of file print.h.


Function Documentation

PCL_EXPORTS void pcl::console::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
PCL_EXPORTS void pcl::console::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
PCL_EXPORTS int pcl::console::find_argument ( int  argc,
char **  argv,
const char *  argument_name 
)

finds the position of the argument with name "argument_name" in the argument list "argv"

Parameters:
argc the number of command line arguments
argv the command line arguments
argument_name the string value to search for
Returns:
index of found argument or -1 of arguments does not appear in list
PCL_EXPORTS VERBOSITY_LEVEL pcl::console::getVerbosityLevel (  ) 

get the verbosity level.

PCL_EXPORTS bool pcl::console::initVerbosityLevel (  ) 

initialize verbosity level.

PCL_EXPORTS bool pcl::console::isVerbosityLevelEnabled ( VERBOSITY_LEVEL  severity  ) 

is verbosity level enabled?

template<typename Type >
int pcl::console::parse ( int  argc,
char **  argv,
const char *  argument_name,
Type &  value 
)

template version for parsing arguments.

Template parameter needs to have input stream operator overloaded!

Parameters:
argc the number of command line arguments
argv the command line arguments
argument_name the name of the argument to search for
value The value of the argument
Returns:
index of found argument or -1 of arguments does not appear in list

Definition at line 71 of file parse.h.

PCL_EXPORTS int pcl::console::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
debug whether to print debug info or not
PCL_EXPORTS int pcl::console::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
debug whether to print debug info or not
PCL_EXPORTS int pcl::console::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
debug whether to print debug info or not
PCL_EXPORTS int pcl::console::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
debug whether to print debug info or not
PCL_EXPORTS int pcl::console::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
PCL_EXPORTS int pcl::console::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
PCL_EXPORTS int pcl::console::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
PCL_EXPORTS int pcl::console::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
PCL_EXPORTS int pcl::console::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
PCL_EXPORTS std::vector<int> pcl::console::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.

Parameters:
argc the number of command line arguments
argv the command line arguments
ext the extension to search for
PCL_EXPORTS bool pcl::console::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
PCL_EXPORTS bool pcl::console::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
PCL_EXPORTS bool pcl::console::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
PCL_EXPORTS bool pcl::console::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
PCL_EXPORTS bool pcl::console::parse_multiple_arguments ( int  argc,
char **  argv,
const char *  str,
std::vector< std::string > &  values 
)

Parse for a specific given command line argument (multiple occurences of the same command line parameter).

Returns the value sent as a vector.

Parameters:
argc the number of command line arguments
argv the command line arguments
str the string value to search for
values the resultant output values
PCL_EXPORTS void pcl::console::print ( VERBOSITY_LEVEL  level,
FILE *  stream,
const char *  format,
  ... 
)

Print a message on stream.

Parameters:
level the verbosity level
stream the output stream (stdout, stderr, etc)
format the message
PCL_EXPORTS void pcl::console::print ( VERBOSITY_LEVEL  level,
const char *  format,
  ... 
)

Print a message.

Parameters:
level the verbosity level
format the message
PCL_EXPORTS void pcl::console::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)
attr the text attribute
fg the foreground color
format the message
PCL_EXPORTS void pcl::console::print_debug ( const char *  format,
  ... 
)

Print a debug message on stream with colors.

Parameters:
format the message
PCL_EXPORTS void pcl::console::print_debug ( FILE *  stream,
const char *  format,
  ... 
)

Print a debug message on stream with colors.

Parameters:
stream the output stream (stdout, stderr, etc)
format the message
PCL_EXPORTS void pcl::console::print_error ( const char *  format,
  ... 
)

Print an error message on stream with colors.

Parameters:
format the message
PCL_EXPORTS void pcl::console::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
PCL_EXPORTS void pcl::console::print_highlight ( const char *  format,
  ... 
)

Print a highlighted info message on stream with colors.

Parameters:
format the message
PCL_EXPORTS void pcl::console::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
PCL_EXPORTS void pcl::console::print_info ( const char *  format,
  ... 
)

Print an info message on stream with colors.

Parameters:
format the message
PCL_EXPORTS void pcl::console::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
PCL_EXPORTS void pcl::console::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
PCL_EXPORTS void pcl::console::print_value ( const char *  format,
  ... 
)

Print a value message on stream with colors.

Parameters:
format the message
PCL_EXPORTS void pcl::console::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
PCL_EXPORTS void pcl::console::print_warn ( const char *  format,
  ... 
)

Print a warning message on stream with colors.

Parameters:
format the message
PCL_EXPORTS void pcl::console::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)
PCL_EXPORTS void pcl::console::setVerbosityLevel ( VERBOSITY_LEVEL  level  ) 

set the verbosity level