Geogram  Version 1.9.1-rc
A programming library of geometric algorithms
command_line.h File Reference

Functions to parse and store command line arguments. More...

Go to the source code of this file.

Namespaces

 GEO
 Global Vorpaline namespace.
 
 GEO::CmdLine
 Utilities to process command line arguments.
 

Typedefs

typedef char ** GEO::CmdLine::charptrptr
 

Enumerations

enum  GEO::CmdLine::ArgType {
  GEO::CmdLine::ARG_UNDEFINED = 0 , GEO::CmdLine::ARG_INT = 1 , GEO::CmdLine::ARG_DOUBLE = 2 , GEO::CmdLine::ARG_STRING = 4 ,
  GEO::CmdLine::ARG_BOOL = 8 , GEO::CmdLine::ARG_PERCENT = 16
}
 Command line argument types. More...
 
enum  GEO::CmdLine::ArgFlags { GEO::CmdLine::ARG_FLAGS_DEFAULT = 0 , GEO::CmdLine::ARG_ADVANCED = 1 }
 Command line group or argument flags. More...
 

Functions

void GEO::CmdLine::initialize ()
 Initializes the command line framework. More...
 
void GEO::CmdLine::terminate ()
 Cleans up the command line framework. More...
 
void GEO::CmdLine::set_config_file_name (const std::string &filename, bool auto_create_args=false)
 Defines the name of the configuration file. More...
 
bool GEO::CmdLine::config_file_loaded ()
 Tests whether the configuration file was loaded. More...
 
std::string GEO::CmdLine::get_config_file_name ()
 Gets the name of the configuration file. More...
 
void GEO::CmdLine::load_config (const std::string &filename, const std::string &program_name)
 Loads command line argument values from a file. More...
 
void GEO::CmdLine::declare_arg_group (const std::string &name, const std::string &description, ArgFlags flags=ARG_FLAGS_DEFAULT)
 Declares an argument group. More...
 
void GEO::CmdLine::declare_arg (const std::string &name, ArgType type, const std::string &default_value, const std::string &description, ArgFlags flags=ARG_FLAGS_DEFAULT)
 Declares an argument. More...
 
ArgType GEO::CmdLine::get_arg_type (const std::string &name)
 Gets the type of an argument. More...
 
bool GEO::CmdLine::arg_is_declared (const std::string &name)
 Checks if an argument exists. More...
 
void GEO::CmdLine::declare_arg (const std::string &name, const std::string &default_value, const std::string &description, ArgFlags flags=ARG_FLAGS_DEFAULT)
 Declares an argument of type string. More...
 
void GEO::CmdLine::declare_arg (const std::string &name, const char *default_value, const std::string &description, ArgFlags flags=ARG_FLAGS_DEFAULT)
 Declares an argument of type string. More...
 
void GEO::CmdLine::declare_arg (const std::string &name, int default_value, const std::string &description, ArgFlags flags=ARG_FLAGS_DEFAULT)
 Declares an argument of type integer. More...
 
void GEO::CmdLine::declare_arg (const std::string &name, double default_value, const std::string &description, ArgFlags flags=ARG_FLAGS_DEFAULT)
 Declares an argument of type floating point. More...
 
void GEO::CmdLine::declare_arg (const std::string &name, bool default_value, const std::string &description, ArgFlags flags=ARG_FLAGS_DEFAULT)
 Declares an argument of type boolean. More...
 
void GEO::CmdLine::declare_arg_percent (const std::string &name, double default_value, const std::string &description="...", ArgFlags flags=ARG_FLAGS_DEFAULT)
 Declares an argument of type percentage. More...
 
bool GEO::CmdLine::parse (int argc, char **argv, std::vector< std::string > &unparsed_args, const std::string &additional_arg_specs="")
 Parses the command line arguments. More...
 
bool GEO::CmdLine::parse (int argc, char **argv)
 Parses the command line arguments. More...
 
int GEO::CmdLine::argc ()
 Gets the number of arguments of the command line. More...
 
charptrptr GEO::CmdLine::argv ()
 Gets the command line arguments. More...
 
void GEO::CmdLine::show_usage (const std::string &additional_args="", bool advanced=false)
 Displays program help. More...
 
std::string GEO::CmdLine::get_arg (const std::string &name)
 Gets an argument value. More...
 
int GEO::CmdLine::get_arg_int (const std::string &name)
 Gets an argument value as an integer. More...
 
unsigned int GEO::CmdLine::get_arg_uint (const std::string &name)
 Gets an argument value as an unsigned integer. More...
 
double GEO::CmdLine::get_arg_double (const std::string &name)
 Gets an argument value as a floating point. More...
 
double GEO::CmdLine::get_arg_percent (const std::string &name, double reference)
 Gets an argument value as a percentage. More...
 
bool GEO::CmdLine::get_arg_bool (const std::string &name)
 Gets an argument value as a boolean. More...
 
bool GEO::CmdLine::set_arg (const std::string &name, const std::string &value)
 Sets an argument value from a string. More...
 
bool GEO::CmdLine::set_arg (const std::string &name, const char *value)
 Sets an argument value from a C-string. More...
 
void GEO::CmdLine::set_arg (const std::string &name, Numeric::int32 value)
 Sets an argument value from an integer. More...
 
void GEO::CmdLine::set_arg (const std::string &name, Numeric::uint32 value)
 
void GEO::CmdLine::set_arg (const std::string &name, Numeric::int64 value)
 
void GEO::CmdLine::set_arg (const std::string &name, Numeric::uint64 value)
 
void GEO::CmdLine::set_arg (const std::string &name, double value)
 Sets an argument value from a floating point. More...
 
void GEO::CmdLine::set_arg (const std::string &name, bool value)
 Sets an argument value from a boolean. More...
 
void GEO::CmdLine::set_arg_percent (const std::string &name, double value)
 Sets an argument value from a percentage. More...
 
void GEO::CmdLine::get_args (std::vector< std::string > &args)
 Gets the value of all arguments. More...
 
index_t GEO::CmdLine::ui_terminal_width ()
 Gets the width of the console. More...
 
void GEO::CmdLine::ui_separator (const std::string &title, const std::string &short_title="")
 Outputs a separator with a title on the console. More...
 
void GEO::CmdLine::ui_separator ()
 Outputs a separator without a title on the console. More...
 
void GEO::CmdLine::ui_close_separator ()
 Closes an opened separator. More...
 
void GEO::CmdLine::ui_message (const std::string &message, index_t wrap_margin)
 Outputs a message on the console. More...
 
void GEO::CmdLine::ui_message (const std::string &message)
 Outputs a message on the console. More...
 
void GEO::CmdLine::ui_clear_line ()
 Clears the last line. More...
 
void GEO::CmdLine::ui_progress (const std::string &task_name, index_t val, index_t percent, bool clear=true)
 Displays a progress bar. More...
 
void GEO::CmdLine::ui_progress_time (const std::string &task_name, double elapsed, bool clear=true)
 Displays the time elapsed for a completed task. More...
 
void GEO::CmdLine::ui_progress_canceled (const std::string &task_name, double elapsed, index_t percent, bool clear=true)
 Displays the time elapsed for a canceled task. More...
 
std::string GEO::CmdLine::ui_feature (const std::string &feature, bool show=true)
 Formats a Logger feature name. More...
 

Detailed Description

Functions to parse and store command line arguments.

Definition in file command_line.h.