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 n_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);
48 parameter (string shortname, string longname,string description, int * status,
49 string * target=NULL, string placeholder=string("<string>"));
60 free_parameter (string placeholder,string description,
61 int * status, string * target);
68 vector<parameter>arguments;
69 vector<free_parameter>free_arguments;