1 #ifndef ARGUMENT_READER_H
2 #define ARGUMENT_READER_H
10 *\brief Hachti's wonderful commandline parser.
12 * This class is designed to do all the work with the parameters passed to
13 * the main() routine of a program.\n
15 * - Create an instance.
16 * - Add Parameters/switches with add_param().
17 * - Add Arguments with add_argument().
18 * - Call read_args() with your main routine's arguments.
19 * The vector returned by read_args() contains all error
20 * messages. When it's empty, everything is fine!
21 * - Call get_help() if you want nice formatted help output.
23 * Sould be easy to use..... Enjoy.
25 class argument_reader{
28 argument_reader(string name);
30 void add_param (string shortname,
35 string placeholder=string("<string>")
38 vector<string> read_args(int argc, char ** args);
40 void get_help(vector<string> & target);
41 vector<string> get_help();
43 void add_argument(string placeholder, string description, int * status, string * target);
47 *\brief Container for one command line option.
51 opt_t (string shortname, string longname,string description, int * status,
52 string * target=NULL, string placeholder=string("<string>"));
62 *\brief Container for one command line argument.
66 arg_t (string placeholder,string description,
67 int * status, string * target);
77 }; // class argument_reader