* - Create an instance.
* - Add Parameters/switches with add_param().
* - Add Arguments with add_argument().
- * - Call read_args() with your main routine's arguments.\
- * The vector returned by read_args() contains all error \
+ * - Call read_args() with your main routine's arguments.
+ * The vector returned by read_args() contains all error
* messages. When it's empty, everything is fine!
- * - Call get_help() if you want nice formatted help output. \
+ * - Call get_help() if you want nice formatted help output.
* (You want!!!)
* Sould be easy to use..... Enjoy.
*/
class argument_reader{
public:
- argument_reader(string n_name);
+ argument_reader(string name);
- void add_param (string shortname,
- string longname,
- string description,
- int * status,
- string * target=NULL,
+ void add_param (string shortname,
+ string longname,
+ string description,
+ int *status,
+ string *target=NULL,
string placeholder=string("<string>")
);
void add_argument(string placeholder, string description, int * status, string * target);
private:
- class parameter{
+ /*!
+ *\brief Container for one command line option.
+ */
+ class opt_t{
public:
- parameter (string shortname, string longname,string description, int * status,
+ opt_t (string shortname, string longname,string description, int * status,
string * target=NULL, string placeholder=string("<string>"));
string shortname;
string longname;
string placeholder;
};
- class free_parameter{
+ /*!
+ *\brief Container for one command line argument.
+ */
+ class arg_t{
public:
- free_parameter (string placeholder,string description,
+ arg_t (string placeholder,string description,
int * status, string * target);
int * status;
string * target;
string description;
string placeholder;
};
+ vector<opt_t>opt_v;
+ vector<arg_t>arg_v;
+ string app_name;
- vector<parameter>arguments;
- vector<free_parameter>free_arguments;
-
- string progname;
-};
+}; // class argument_reader
#endif