1 #ifndef ARGUMENT_READER_H
2 #define ARGUMENT_READER_H
10 *\brief Hachti's even more wonderful configuration manager.
12 * This class is designed to do all the work with the parameters passed to
13 * the main() routine of a program.\n
14 * Additionally, it is able to interpret configuration files.
16 * - Create an instance.
17 * - Add Parameters/switches with add_param().
18 * - Add Arguments with add_argument().
19 * - Call read_args() with your main routine's arguments.
20 * The vector returned by read_args() contains all error
21 * messages. When it's empty, everything is fine!
22 * - Call get_help() if you want nice formatted help output.
24 * Sould be easy to use..... Enjoy.
26 class configuration_manager{
29 configuration_manager(string name);
31 void add_option_switch (string shortname,
35 bool allow_commandline=true,
36 bool allow_config_file=true
39 void add_option_value (string shortname,
43 bool allow_commandline=true,
44 bool allow_config_file=true,
46 string placeholder=string("<string>")
49 void add_argument (string longname,
53 string placeholder=string("<string>")
56 vector<string> read_args(int argc, char ** args);
57 vector<string> read_file(string filename);
59 void get_help (vector<string> & target);
60 vector<string> get_help();
64 *\brief Container for an option switch
68 opt_switch_t (string shortname, string longname,string description, int * status
69 string * target=NULL, string placeholder=string("<string>"));
78 *\brief Container for an option value
82 switch_t (string shortname, string longname,string description, int * status
83 string * target=NULL, string placeholder=string("<string>"));
95 *\brief Container for a commandline argument
99 arg_t (string placeholder,string description,
100 int * status, string * target);
107 vector<opt_switch_t>option_switches;
108 vector<opt_value_t>option_values;
109 vector<cmd_arg_t>cmd_args;
112 }; // class configuration_manager