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 argument_reader{
29 argument_reader(string name);
31 void add_param (string shortname,
35 bool allow_commandline=true,
36 bool allow_config_file=true,
38 string placeholder=string("<string>")
41 vector<string> read_args(int argc, char ** args);
42 vector<string> read_file(string filename);
44 void get_help (vector<string> & target);
45 vector<string> get_help();
47 void add_argument(string placeholder, string description, int * status, string * target);
51 *\brief Container for one command line option.
55 opt_t (string shortname, string longname,string description, int * status,
56 string * target=NULL, string placeholder=string("<string>"));
66 *\brief Container for one command line argument.
70 arg_t (string placeholder,string description,
71 int * status, string * target);
81 }; // class argument_reader