30 #ifndef __CLAW_ARGUMENTS_HPP__
31 #define __CLAW_ARGUMENTS_HPP__
54 std::map< std::string, std::list<std::string> > valued_arguments_map;
58 explicit arguments(
const std::string& prog_name );
63 void parse(
int& argc,
char** &argv );
64 void parse(
int& argc,
char** &argv,
67 bool has_value(
const std::string& arg_name )
const;
73 bool get_bool(
const std::string& arg_name )
const;
74 int get_integer(
const std::string& arg_name )
const;
75 double get_real(
const std::string& arg_name )
const;
76 const std::string&
get_string(
const std::string& arg_name )
const;
80 std::list<std::string>
86 void parse(
int& argc,
char** &argv,
bool always_allowed,
89 (
const std::string& arg, std::string& name, std::string& value )
const;
91 void remove_null_arguments(
int& argc,
char** &argv )
const;
94 (
char* &arg,
bool always_allowed,
99 std::string m_program_name;
105 valued_arguments_map m_pairs;
110 #endif // __CLAW_ARGUMENTS_HPP__
bool get_bool(const std::string &arg_name) const
Get the boolean state of an argument.
bool only_integer_values(const std::string &arg_name) const
Tell if only integer values are associated to an argument.
bool has_value(const std::string &arg_name) const
Tell if a value is associated to an argument.
void parse(int &argc, char **&argv)
Parse arguments.
std::list< int > get_all_of_integer(const std::string &arg_name) const
Get all integer values of an argument.
A class to manage sets of ordered items.
const std::string & get_string(const std::string &arg_name) const
Get the string value of an argument.
A class to manage the arguments of your program.
std::list< double > get_all_of_real(const std::string &arg_name) const
Get all real values of an argument.
const std::string & get_program_name() const
Get the name of the program.
int get_integer(const std::string &arg_name) const
Get the integer value of an argument.
void add_argument(const std::string &arg)
Add an argument in our list.
std::list< std::string > get_all_of_string(const std::string &arg_name) const
Get all string values of an argument.
bool only_real_values(const std::string &arg_name) const
Tell if only real values are associated to an argument.
double get_real(const std::string &arg_name) const
Get the real value of an argument.
This is the main namespace.