Point Cloud Library (PCL)  1.15.1-dev
Classes | Enumerations | Functions
pcl::console Namespace Reference

Classes

struct  LogRecord
 Structure to hold a log record Used by the Logger class. More...
 
class  Logger
 Logger used to log messages with different verbosity levels Can be used to redirect log messages to custom outputs by setting a callback. More...
 
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 bool find_switch (int argc, const char *const *argv, const char *argument_name)
 Finds whether the argument with name "argument_name" is in the argument list "argv". More...
 
PCL_EXPORTS int find_argument (int argc, const char *const *argv, const char *argument_name)
 Finds the position of the argument with name "argument_name" in the argument list "argv". More...
 
template<typename Type >
int parse (int argc, const char *const *argv, const char *argument_name, Type &value)
 Template version for parsing arguments. More...
 
PCL_EXPORTS int parse_argument (int argc, const char *const *argv, const char *str, std::string &val)
 Parse for a specific given command line argument. More...
 
PCL_EXPORTS int parse_argument (int argc, const char *const *argv, const char *str, bool &val)
 Parse for a specific given command line argument. More...
 
PCL_EXPORTS int parse_argument (int argc, const char *const *argv, const char *str, float &val)
 Parse for a specific given command line argument. More...
 
PCL_EXPORTS int parse_argument (int argc, const char *const *argv, const char *str, double &val)
 Parse for a specific given command line argument. More...
 
PCL_EXPORTS int parse_argument (int argc, const char *const *argv, const char *str, int &val)
 Parse for a specific given command line argument. More...
 
PCL_EXPORTS int parse_argument (int argc, const char *const *argv, const char *str, unsigned int &val)
 Parse for a specific given command line argument. More...
 
PCL_EXPORTS int parse_argument (int argc, const char *const *argv, const char *str, long int &val) noexcept
 Parse for a specific given command line argument. More...
 
PCL_EXPORTS int parse_argument (int argc, const char *const *argv, const char *str, char &val)
 Parse for a specific given command line argument. More...
 
PCL_EXPORTS int parse_2x_arguments (int argc, const char *const *argv, const char *str, float &f, float &s, bool debug=true)
 Parse for specific given command line arguments (2x values comma separated). More...
 
PCL_EXPORTS int parse_2x_arguments (int argc, const char *const *argv, const char *str, double &f, double &s, bool debug=true)
 Parse for specific given command line arguments (2x values comma separated). More...
 
PCL_EXPORTS int parse_2x_arguments (int argc, const char *const *argv, const char *str, int &f, int &s, bool debug=true)
 Parse for specific given command line arguments (2x values comma separated). More...
 
PCL_EXPORTS int parse_3x_arguments (int argc, const char *const *argv, const char *str, float &f, float &s, float &t, bool debug=true)
 Parse for specific given command line arguments (3x values comma separated). More...
 
PCL_EXPORTS int parse_3x_arguments (int argc, const char *const *argv, const char *str, double &f, double &s, double &t, bool debug=true)
 Parse for specific given command line arguments (3x values comma separated). More...
 
PCL_EXPORTS int parse_3x_arguments (int argc, const char *const *argv, const char *str, int &f, int &s, int &t, bool debug=true)
 Parse for specific given command line arguments (3x values comma separated). More...
 
PCL_EXPORTS int parse_x_arguments (int argc, const char *const *argv, const char *str, std::vector< double > &v)
 Parse for specific given command line arguments (3x values comma separated). More...
 
PCL_EXPORTS int parse_x_arguments (int argc, const char *const *argv, const char *str, std::vector< float > &v)
 Parse for specific given command line arguments (N values comma separated). More...
 
PCL_EXPORTS int parse_x_arguments (int argc, const char *const *argv, const char *str, std::vector< int > &v)
 Parse for specific given command line arguments (N values comma separated). More...
 
PCL_EXPORTS bool parse_multiple_arguments (int argc, const char *const *argv, const char *str, std::vector< int > &values)
 Parse for specific given command line arguments (multiple occurrences of the same command line parameter). More...
 
PCL_EXPORTS bool parse_multiple_arguments (int argc, const char *const *argv, const char *str, std::vector< float > &values)
 Parse for specific given command line arguments (multiple occurrences of the same command line parameter). More...
 
PCL_EXPORTS bool parse_multiple_arguments (int argc, const char *const *argv, const char *str, std::vector< double > &values)
 Parse for specific given command line arguments (multiple occurrences of the same command line parameter). More...
 
PCL_EXPORTS bool parse_multiple_arguments (int argc, const char *const *argv, const char *str, std::vector< std::string > &values)
 Parse for a specific given command line argument (multiple occurrences of the same command line parameter). More...
 
PCL_EXPORTS bool parse_multiple_2x_arguments (int argc, const char *const *argv, const char *str, std::vector< double > &values_f, std::vector< double > &values_s)
 Parse command line arguments for file names with given extension (multiple occurrences of 2x argument groups, separated by commas). More...
 
PCL_EXPORTS bool parse_multiple_3x_arguments (int argc, const char *const *argv, const char *str, std::vector< double > &values_f, std::vector< double > &values_s, std::vector< double > &values_t)
 Parse command line arguments for file names with given extension (multiple occurrences of 3x argument groups, separated by commas). More...
 
PCL_EXPORTS std::vector< int > parse_file_extension_argument (int argc, const char *const *argv, const std::vector< std::string > &extensions)
 Parse command line arguments for file names with given extension vector. More...
 
PCL_EXPORTS std::vector< int > parse_file_extension_argument (int argc, const char *const *argv, const std::string &ext)
 Parse command line arguments for file names with given extension. More...
 
PCL_EXPORTS void setVerbosityLevel (VERBOSITY_LEVEL level)
 set the verbosity level More...
 
PCL_EXPORTS VERBOSITY_LEVEL getVerbosityLevel ()
 get the verbosity level. More...
 
PCL_EXPORTS bool initVerbosityLevel ()
 initialize verbosity level. More...
 
PCL_EXPORTS bool isVerbosityLevelEnabled (VERBOSITY_LEVEL severity)
 is verbosity level enabled? More...
 
PCL_EXPORTS void enableColoredOutput (FILE *stream, bool enable)
 Enable or disable colored text output, overriding the default behavior. More...
 
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. More...
 
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. More...
 
PCL_EXPORTS void reset_text_color (FILE *stream)
 Reset the text color (on either stdout or stderr) to its original state. More...
 
template<typename Functor >
void setCallback (Functor &&callback)
 Sets a callable in the Logger instance, which is called whenever a printout has occured. More...
 
template<typename... Args>
std::string to_string (const std::string fmt_str,...)
 insert values into a formatted string More...
 
template<typename... Args>
PCL_EXPORTS void print_info (FILE *stream, const std::string format, Args &&... args)
 Print an info message on stream with colors. More...
 
template<typename... Args>
PCL_EXPORTS void print_info (const std::string format, Args &&... args)
 Print an info message on stream with colors. More...
 
template<typename... Args>
PCL_EXPORTS void print_error (FILE *stream, const std::string format, Args &&... args)
 Print an error message on stream with colors. More...
 
template<typename... Args>
PCL_EXPORTS void print_error (std::string format, Args &&... args)
 Print an error message on stream with colors. More...
 
template<typename... Args>
PCL_EXPORTS void print_warn (FILE *stream, const std::string format, Args &&... args)
 Print a warning message on stream with colors. More...
 
template<typename... Args>
PCL_EXPORTS void print_warn (std::string format, Args &&... args)
 Print a warning message on stream with colors. More...
 
template<typename... Args>
PCL_EXPORTS void print_debug (FILE *stream, const std::string format, Args &&... args)
 Print a debug message on stream with colors. More...
 
template<typename... Args>
PCL_EXPORTS void print_debug (const std::string format, Args &&... args)
 Print a debug message on stream with colors. More...
 
template<typename... Args>
PCL_EXPORTS void print_color (FILE *stream, int attr, int fg, const std::string format, Args &&... args)
 Print a message on stream with colors. More...
 
template<typename... Args>
PCL_EXPORTS void print_value (FILE *stream, const std::string format, Args &&... args)
 Print a value message on stream with colors. More...
 
template<typename... Args>
PCL_EXPORTS void print_value (const std::string format, Args &&... args)
 Print a value message on stream with colors. More...
 
template<typename... Args>
PCL_EXPORTS void print (VERBOSITY_LEVEL level, FILE *stream, const std::string format, Args &&...args)
 Print a message on stream. More...
 
template<typename... Args>
void print (VERBOSITY_LEVEL level, const std::string format, Args &&... args)
 Print a message. More...
 
template<typename... Args>
PCL_EXPORTS void print_highlight (FILE *stream, const std::string format, Args... args)
 Print a highlighted info message on stream with colors. More...
 
template<typename... Args>
PCL_EXPORTS void print_highlight (const std::string format, Args &&...args)
 Print a highlighted info message on stream with colors. More...
 

Enumeration Type Documentation

◆ TT_ATTIBUTES

Enumerator
TT_RESET 
TT_BRIGHT 
TT_DIM 
TT_UNDERLINE 
TT_BLINK 
TT_REVERSE 
TT_HIDDEN 

Definition at line 102 of file print.h.

◆ TT_COLORS

Enumerator
TT_BLACK 
TT_RED 
TT_GREEN 
TT_YELLOW 
TT_BLUE 
TT_MAGENTA 
TT_CYAN 
TT_WHITE 

Definition at line 113 of file print.h.

◆ VERBOSITY_LEVEL

Enumerator
L_ALWAYS 
L_ERROR 
L_WARN 
L_INFO 
L_DEBUG 
L_VERBOSE 

Definition at line 125 of file print.h.

Function Documentation

◆ change_text_color() [1/2]

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
streamthe output stream (stdout, stderr, etc)
attributethe text attribute
fgthe foreground color

◆ change_text_color() [2/2]

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
streamthe output stream (stdout, stderr, etc)
attributethe text attribute
fgthe foreground color
bgthe background color

◆ enableColoredOutput()

PCL_EXPORTS void pcl::console::enableColoredOutput ( FILE *  stream,
bool  enable 
)

Enable or disable colored text output, overriding the default behavior.

By default, colored output is enabled for interactive terminals or when the environment variable PCL_CLICOLOR_FORCE is set.

Parameters
streamthe output stream (stdout, stderr, etc)
enablewhether to emit color codes when calling any of the color related methods

◆ find_argument()

PCL_EXPORTS int pcl::console::find_argument ( int  argc,
const char *const *  argv,
const char *  argument_name 
)

Finds the position of the argument with name "argument_name" in the argument list "argv".

Parameters
[in]argcthe number of command line arguments
[in]argvthe command line arguments
[in]argument_namethe string value to search for
Returns
index of found argument or -1 if arguments do not appear in list

Referenced by parse().

◆ find_switch()

PCL_EXPORTS bool pcl::console::find_switch ( int  argc,
const char *const *  argv,
const char *  argument_name 
)

Finds whether the argument with name "argument_name" is in the argument list "argv".

An example for a widely used switch argument is the "-r" flag for unix commands that indicates whether the command should run recursively or not.

Parameters
[in]argcthe number of command line arguments
[in]argvthe command line arguments
[in]argument_namethe string value to search for
Returns
true if argument was found, false otherwise
Note
find_switch is simply returning find_argument != -1.

◆ getVerbosityLevel()

PCL_EXPORTS VERBOSITY_LEVEL pcl::console::getVerbosityLevel ( )

get the verbosity level.

◆ initVerbosityLevel()

PCL_EXPORTS bool pcl::console::initVerbosityLevel ( )

initialize verbosity level.

◆ isVerbosityLevelEnabled()

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

◆ parse()

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

Template version for parsing arguments.

Template parameter needs to have input stream operator overloaded!

Parameters
[in]argcthe number of command line arguments
[in]argvthe command line arguments
[in]argument_namethe name of the argument to search for
[out]valueThe value of the argument
Returns
index of found argument or -1 if arguments do not appear in list

Definition at line 78 of file parse.h.

References find_argument().

◆ parse_2x_arguments() [1/3]

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

Parse for specific given command line arguments (2x values comma separated).

Parameters
[in]argcthe number of command line arguments
[in]argvthe command line arguments
[in]strthe command line argument to search for
[out]fthe first output value
[out]sthe second output value
[in]debugwhether to print debug info or not
Returns
index of found argument or -1 if arguments do not appear in list

◆ parse_2x_arguments() [2/3]

PCL_EXPORTS int pcl::console::parse_2x_arguments ( int  argc,
const char *const *  argv,
const char *  str,
float &  f,
float &  s,
bool  debug = true 
)

Parse for specific given command line arguments (2x values comma separated).

Parameters
[in]argcthe number of command line arguments
[in]argvthe command line arguments
[in]strthe command line argument to search for
[out]fthe first output value
[out]sthe second output value
[in]debugwhether to print debug info or not
Returns
index of found argument or -1 if arguments do not appear in list

◆ parse_2x_arguments() [3/3]

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

Parse for specific given command line arguments (2x values comma separated).

Parameters
[in]argcthe number of command line arguments
[in]argvthe command line arguments
[in]strthe command line argument to search for
[out]fthe first output value
[out]sthe second output value
[in]debugwhether to print debug info or not
Returns
index of found argument or -1 if arguments do not appear in list

◆ parse_3x_arguments() [1/3]

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

Parse for specific given command line arguments (3x values comma separated).

Parameters
[in]argcthe number of command line arguments
[in]argvthe command line arguments
[in]strthe command line argument to search for
[out]fthe first output value
[out]sthe second output value
[out]tthe third output value
[in]debugwhether to print debug info or not
Returns
index of found argument or -1 if arguments do not appear in list

◆ parse_3x_arguments() [2/3]

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

Parse for specific given command line arguments (3x values comma separated).

Parameters
[in]argcthe number of command line arguments
[in]argvthe command line arguments
[in]strthe command line argument to search for
[out]fthe first output value
[out]sthe second output value
[out]tthe third output value
[in]debugwhether to print debug info or not
Returns
index of found argument or -1 if arguments do not appear in list

◆ parse_3x_arguments() [3/3]

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

Parse for specific given command line arguments (3x values comma separated).

Parameters
[in]argcthe number of command line arguments
[in]argvthe command line arguments
[in]strthe command line argument to search for
[out]fthe first output value
[out]sthe second output value
[out]tthe third output value
[in]debugwhether to print debug info or not return index of found argument or -1 if arguments do not appear in list

◆ parse_argument() [1/8]

PCL_EXPORTS int pcl::console::parse_argument ( int  argc,
const char *const *  argv,
const char *  str,
bool &  val 
)

Parse for a specific given command line argument.

Parameters
[in]argcthe number of command line arguments
[in]argvthe command line arguments
[in]strthe string value to search for
[out]valthe resultant value
Returns
index of found argument or -1 if arguments do not appear in list

◆ parse_argument() [2/8]

PCL_EXPORTS int pcl::console::parse_argument ( int  argc,
const char *const *  argv,
const char *  str,
char &  val 
)

Parse for a specific given command line argument.

Parameters
[in]argcthe number of command line arguments
[in]argvthe command line arguments
[in]strthe string value to search for
[out]valthe resultant value
Returns
index of found argument or -1 if arguments do not appear in list

◆ parse_argument() [3/8]

PCL_EXPORTS int pcl::console::parse_argument ( int  argc,
const char *const *  argv,
const char *  str,
double &  val 
)

Parse for a specific given command line argument.

Parameters
[in]argcthe number of command line arguments
[in]argvthe command line arguments
[in]strthe string value to search for
[out]valthe resultant value
Returns
index of found argument or -1 if arguments do not appear in list

◆ parse_argument() [4/8]

PCL_EXPORTS int pcl::console::parse_argument ( int  argc,
const char *const *  argv,
const char *  str,
float &  val 
)

Parse for a specific given command line argument.

Parameters
[in]argcthe number of command line arguments
[in]argvthe command line arguments
[in]strthe string value to search for
[out]valthe resultant value
Returns
index of found argument or -1 if arguments do not appear in list

◆ parse_argument() [5/8]

PCL_EXPORTS int pcl::console::parse_argument ( int  argc,
const char *const *  argv,
const char *  str,
int &  val 
)

Parse for a specific given command line argument.

Parameters
[in]argcthe number of command line arguments
[in]argvthe command line arguments
[in]strthe string value to search for
[out]valthe resultant value
Returns
index of found argument or -1 if arguments do not appear in list

◆ parse_argument() [6/8]

PCL_EXPORTS int pcl::console::parse_argument ( int  argc,
const char *const *  argv,
const char *  str,
long int &  val 
)
noexcept

Parse for a specific given command line argument.

Parameters
[in]argcthe number of command line arguments
[in]argvthe command line arguments
[in]strthe string value to search for
[out]valthe resultant value
Returns
index of found argument or -1 if arguments do not appear in list

◆ parse_argument() [7/8]

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

Parse for a specific given command line argument.

Parameters
[in]argcthe number of command line arguments
[in]argvthe command line arguments
[in]strthe string value to search for
[out]valthe resultant value
Returns
index of found argument or -1 if arguments do not appear in list

◆ parse_argument() [8/8]

PCL_EXPORTS int pcl::console::parse_argument ( int  argc,
const char *const *  argv,
const char *  str,
unsigned int &  val 
)

Parse for a specific given command line argument.

Parameters
[in]argcthe number of command line arguments
[in]argvthe command line arguments
[in]strthe string value to search for
[out]valthe resultant value
Returns
index of found argument or -1 if arguments do not appear in list

◆ parse_file_extension_argument() [1/2]

PCL_EXPORTS std::vector<int> pcl::console::parse_file_extension_argument ( int  argc,
const char *const *  argv,
const std::string &  ext 
)

Parse command line arguments for file names with given extension.

Parameters
[in]argcthe number of command line arguments
[in]argvthe command line arguments
[in]extthe extension to search for
Returns
a vector with file names indices

◆ parse_file_extension_argument() [2/2]

PCL_EXPORTS std::vector<int> pcl::console::parse_file_extension_argument ( int  argc,
const char *const *  argv,
const std::vector< std::string > &  extensions 
)

Parse command line arguments for file names with given extension vector.

Parameters
[in]argcthe number of command line arguments
[in]argvthe command line arguments
[in]extensionsthe extensions to search for
Returns
a vector with file names indices

◆ parse_multiple_2x_arguments()

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

Parse command line arguments for file names with given extension (multiple occurrences of 2x argument groups, separated by commas).

Parameters
[in]argcthe number of command line arguments
[in]argvthe command line arguments
[in]strthe command line argument to search for
[out]values_fthe first vector of output values
[out]values_sthe second vector of output values
Returns
true if found, false otherwise

◆ parse_multiple_3x_arguments()

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

Parse command line arguments for file names with given extension (multiple occurrences of 3x argument groups, separated by commas).

Parameters
[in]argcthe number of command line arguments
[in]argvthe command line arguments
[in]strthe command line argument to search for
[out]values_fthe first vector of output values
[out]values_sthe second vector of output values
[out]values_tthe third vector of output values
Returns
true if found, false otherwise

◆ parse_multiple_arguments() [1/4]

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

Parse for specific given command line arguments (multiple occurrences of the same command line parameter).

Parameters
[in]argcthe number of command line arguments
[in]argvthe command line arguments
[in]strthe command line argument to search for
[out]valuesthe resultant output values
Returns
true if found, false otherwise

◆ parse_multiple_arguments() [2/4]

PCL_EXPORTS bool pcl::console::parse_multiple_arguments ( int  argc,
const char *const *  argv,
const char *  str,
std::vector< float > &  values 
)

Parse for specific given command line arguments (multiple occurrences of the same command line parameter).

Parameters
[in]argcthe number of command line arguments
[in]argvthe command line arguments
[in]strthe command line argument to search for
[out]valuesthe resultant output values
Returns
true if found, false otherwise

◆ parse_multiple_arguments() [3/4]

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

Parse for specific given command line arguments (multiple occurrences of the same command line parameter).

Parameters
[in]argcthe number of command line arguments
[in]argvthe command line arguments
[in]strthe command line argument to search for
[out]valuesthe resultant output values
Returns
index of found argument or -1 if arguments do not appear in list

◆ parse_multiple_arguments() [4/4]

PCL_EXPORTS bool pcl::console::parse_multiple_arguments ( int  argc,
const char *const *  argv,
const char *  str,
std::vector< std::string > &  values 
)

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

Parameters
[in]argcthe number of command line arguments
[in]argvthe command line arguments
[in]strthe string value to search for
[out]valuesthe resultant output values
Returns
true if found, false otherwise

◆ parse_x_arguments() [1/3]

PCL_EXPORTS int pcl::console::parse_x_arguments ( int  argc,
const char *const *  argv,
const char *  str,
std::vector< double > &  v 
)

Parse for specific given command line arguments (3x values comma separated).

Parameters
[in]argcthe number of command line arguments
[in]argvthe command line arguments
[in]strthe command line argument to search for
[out]vthe vector into which the parsed values will be copied
Returns
index of found argument or -1 if arguments do not appear in list

◆ parse_x_arguments() [2/3]

PCL_EXPORTS int pcl::console::parse_x_arguments ( int  argc,
const char *const *  argv,
const char *  str,
std::vector< float > &  v 
)

Parse for specific given command line arguments (N values comma separated).

Parameters
[in]argcthe number of command line arguments
[in]argvthe command line arguments
[in]strthe command line argument to search for
[out]vthe vector into which the parsed values will be copied
Returns
index of found argument or -1 if arguments do not appear in list

◆ parse_x_arguments() [3/3]

PCL_EXPORTS int pcl::console::parse_x_arguments ( int  argc,
const char *const *  argv,
const char *  str,
std::vector< int > &  v 
)

Parse for specific given command line arguments (N values comma separated).

Parameters
[in]argcthe number of command line arguments
[in]argvthe command line arguments
[in]strthe command line argument to search for
[out]vthe vector into which the parsed values will be copied
Returns
index of found argument or -1 if arguments do not appear in list

◆ print() [1/2]

template<typename... Args>
void pcl::console::print ( VERBOSITY_LEVEL  level,
const std::string  format,
Args &&...  args 
)

Print a message.

Parameters
levelVerbosity level
fmt_strthe string containing the formatting
...argsvalues to be inserted into the fmt_str

Definition at line 433 of file print.h.

References pcl::console::Logger::getInstance(), isVerbosityLevelEnabled(), pcl::console::Logger::print(), and to_string().

◆ print() [2/2]

template<typename... Args>
PCL_EXPORTS void pcl::console::print ( VERBOSITY_LEVEL  level,
FILE *  stream,
const std::string  format,
Args &&...  args 
)

Print a message on stream.

Parameters
levelthe verbosity level
streamthe output stream (stdout, stderr, etc)
formatthe message

Definition at line 415 of file print.h.

References pcl::console::Logger::getInstance(), isVerbosityLevelEnabled(), pcl::console::Logger::print(), and to_string().

Referenced by print_debug(), print_error(), print_info(), and print_warn().

◆ print_color()

template<typename... Args>
PCL_EXPORTS void pcl::console::print_color ( FILE *  stream,
int  attr,
int  fg,
const std::string  format,
Args &&...  args 
)

Print a message on stream with colors.

Parameters
streamthe output stream (stdout, stderr, etc)
attrthe text attribute
fgthe foreground color
formatthe message

Definition at line 378 of file print.h.

References pcl::console::Logger::getInstance(), L_ALWAYS, pcl::console::Logger::print_color(), and to_string().

◆ print_debug() [1/2]

template<typename... Args>
PCL_EXPORTS void pcl::console::print_debug ( const std::string  format,
Args &&...  args 
)

Print a debug message on stream with colors.

Parameters
formatthe message

Definition at line 365 of file print.h.

References print_debug().

◆ print_debug() [2/2]

template<typename... Args>
PCL_EXPORTS void pcl::console::print_debug ( FILE *  stream,
const std::string  format,
Args &&...  args 
)

Print a debug message on stream with colors.

Parameters
streamthe output stream (stdout, stderr, etc)
formatthe message

Definition at line 355 of file print.h.

References L_DEBUG, and print().

Referenced by print_debug().

◆ print_error() [1/2]

template<typename... Args>
PCL_EXPORTS void pcl::console::print_error ( FILE *  stream,
const std::string  format,
Args &&...  args 
)

Print an error message on stream with colors.

Parameters
streamthe output stream (stdout, stderr, etc)
formatthe message

Definition at line 313 of file print.h.

References L_ERROR, and print().

Referenced by pcl::visualization::PCLVisualizer::addPointCloudPrincipalCurvatures(), pcl::TSDFVolume< VoxelT, WeightT >::load(), print_error(), pcl::TSDFVolume< VoxelT, WeightT >::save(), and pcl::visualization::PCLVisualizer::updatePolygonMesh().

◆ print_error() [2/2]

template<typename... Args>
PCL_EXPORTS void pcl::console::print_error ( std::string  format,
Args &&...  args 
)

Print an error message on stream with colors.

Parameters
formatthe message

Definition at line 323 of file print.h.

References print_error().

◆ print_highlight() [1/2]

template<typename... Args>
PCL_EXPORTS void pcl::console::print_highlight ( const std::string  format,
Args &&...  args 
)

Print a highlighted info message on stream with colors.

Parameters
formatthe message

Definition at line 462 of file print.h.

References print_highlight().

◆ print_highlight() [2/2]

template<typename... Args>
PCL_EXPORTS void pcl::console::print_highlight ( FILE *  stream,
const std::string  format,
Args...  args 
)

Print a highlighted info message on stream with colors.

Parameters
streamthe output stream (stdout, stderr, etc)
formatthe message

Definition at line 449 of file print.h.

References pcl::console::Logger::getInstance(), L_INFO, pcl::console::Logger::print_highlight(), and to_string().

Referenced by print_highlight().

◆ print_info() [1/2]

template<typename... Args>
PCL_EXPORTS void pcl::console::print_info ( const std::string  format,
Args &&...  args 
)

Print an info message on stream with colors.

Parameters
formatthe message

Definition at line 302 of file print.h.

References print_info().

◆ print_info() [2/2]

template<typename... Args>
PCL_EXPORTS void pcl::console::print_info ( FILE *  stream,
const std::string  format,
Args &&...  args 
)

Print an info message on stream with colors.

Parameters
streamthe output stream (stdout, stderr, etc)
formatthe message

Definition at line 292 of file print.h.

References L_INFO, and print().

Referenced by pcl::TSDFVolume< VoxelT, WeightT >::addNeighborhood(), pcl::TSDFVolume< VoxelT, WeightT >::extractNeighborhood(), pcl::TSDFVolume< VoxelT, WeightT >::load(), print_info(), pcl::TSDFVolume< VoxelT, WeightT >::save(), and pcl::console::TicToc::toc_print().

◆ print_value() [1/2]

template<typename... Args>
PCL_EXPORTS void pcl::console::print_value ( const std::string  format,
Args &&...  args 
)

Print a value message on stream with colors.

Parameters
formatthe message

Definition at line 403 of file print.h.

References print_value().

◆ print_value() [2/2]

template<typename... Args>
PCL_EXPORTS void pcl::console::print_value ( FILE *  stream,
const std::string  format,
Args &&...  args 
)

Print a value message on stream with colors.

Parameters
streamthe output stream (stdout, stderr, etc)
formatthe message

Definition at line 391 of file print.h.

References pcl::console::Logger::getInstance(), L_ALWAYS, pcl::console::Logger::print_value(), and to_string().

Referenced by pcl::TSDFVolume< VoxelT, WeightT >::load(), print_value(), pcl::TSDFVolume< VoxelT, WeightT >::save(), and pcl::console::TicToc::toc_print().

◆ print_warn() [1/2]

template<typename... Args>
PCL_EXPORTS void pcl::console::print_warn ( FILE *  stream,
const std::string  format,
Args &&...  args 
)

Print a warning message on stream with colors.

Parameters
streamthe output stream (stdout, stderr, etc)
formatthe message

Definition at line 334 of file print.h.

References L_WARN, and print().

Referenced by print_warn(), pcl::TSDFVolume< VoxelT, WeightT >::setHeader(), and pcl::gpu::kinfuLS::TsdfVolume::setHeader().

◆ print_warn() [2/2]

template<typename... Args>
PCL_EXPORTS void pcl::console::print_warn ( std::string  format,
Args &&...  args 
)

Print a warning message on stream with colors.

Parameters
formatthe message

Definition at line 344 of file print.h.

References print_warn().

◆ reset_text_color()

PCL_EXPORTS void pcl::console::reset_text_color ( FILE *  stream)

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

Parameters
streamthe output stream (stdout, stderr, etc)

◆ setCallback()

template<typename Functor >
void pcl::console::setCallback ( Functor &&  callback)

Sets a callable in the Logger instance, which is called whenever a printout has occured.

Template Parameters
Functormatching the definition: std::function<void(const LogRecord&)>
Parameters
callbackthe std::function or lambda to be called
Note
Its possible to reset the logging to console by setting the callback to a nullptr

Definition at line 255 of file print.h.

References pcl::console::Logger::getInstance(), and pcl::console::Logger::setCallback().

◆ setVerbosityLevel()

PCL_EXPORTS void pcl::console::setVerbosityLevel ( VERBOSITY_LEVEL  level)

set the verbosity level

◆ to_string()

template<typename... Args>
std::string pcl::console::to_string ( const std::string  fmt_str,
  ... 
)

insert values into a formatted string

Parameters
fmt_strstring containing the format
valuesto be inserted
Returns
formatted string of type std::string

Definition at line 268 of file print.h.

Referenced by print(), print_color(), print_highlight(), and print_value().