10 #include "wvstringlist.h"
96 bool process(
int argc,
char **argv,
135 WvStringParm desc,
bool &val);
150 WvStringParm desc,
bool &val);
165 WvStringParm desc,
bool &val);
180 void add_option(
char short_option, WvStringParm long_option,
181 WvStringParm desc, WvStringParm arg_desc,
int &val);
195 void add_option(
char short_option, WvStringParm long_option,
196 WvStringParm desc, WvStringParm arg_desc,
long &val);
210 void add_option(
char short_option, WvStringParm long_option,
211 WvStringParm desc, WvStringParm arg_desc,
float &val);
225 void add_option(
char short_option, WvStringParm long_option,
226 WvStringParm desc, WvStringParm arg_desc,
double &val);
240 void add_option(
char short_option, WvStringParm long_option,
241 WvStringParm desc, WvStringParm arg_desc,
WvString &val);
256 void add_option(
char short_option, WvStringParm long_option,
257 WvStringParm desc, WvStringParm arg_desc,
273 void add_option(
char short_option, WvStringParm long_option,
291 void add_option(
char short_option, WvStringParm long_option,
292 WvStringParm desc, WvStringParm arg_desc,
348 void set_flag(
const flags_t flag,
const bool value);
wv::function< bool(WvStringParm, void *)> ArgCallback
The callback type used for switches that take a parameter It returns true if the switch was parsed co...
void set_version(WvStringParm version)
Set the –version string.
void add_option(char short_option, WvStringParm long_option, WvStringParm desc, WvStringParm arg_desc, int &val)
Add a switch that takes an integer argument.
void add_set_bool_option(char short_option, WvStringParm long_option, WvStringParm desc, bool &val)
Add a boolean option, which, when specified, sets the specified boolean variable to true.
bool get_flag(const flags_t flag) const
Get and set flags.
void remove_all_options()
Remove all options.
void add_flip_bool_option(char short_option, WvStringParm long_option, WvStringParm desc, bool &val)
Add a boolean option, which, when spefied, changes the value of the boolean variable from false to tr...
void add_reset_bool_option(char short_option, WvStringParm long_option, WvStringParm desc, bool &val)
Add a boolean option, which, when spefied, sets the specified boolean variable to false.
flags_t
These flags control the behaviour of WvArgs.
WvString is an implementation of a simple and efficient printable-string class.
WvArgs - Sane command-line argument processing for WvStreams.
void set_email(WvStringParm email)
Set the e-mail address for bug reports.
void set_help_header(WvStringParm header)
Set the introductory help message, printed at the beginning of –help.
void set_help_footer(WvStringParm footer)
Set the descriptive help message, printed at the end of –help.
bool process(int argc, char **argv, WvStringList *remaining_args=NULL)
Process the command line arguments passed to main() using the options provided through calls to add_o...
void zap()
An alias for remove_all_options()
void add_required_arg(WvStringParm desc, bool multiple=false)
Add a required argument to the list of parameters.
void add_optional_arg(WvStringParm desc, bool multiple=false)
Add an optional argument to the list of parameters.
This is a WvList of WvStrings, and is a really handy way to parse strings.
void print_usage(int argc, char **argv)
Output the short usage message based on the provided options.
void remove_option(char short_option)
Remove an option by specifying its short form.
void print_help(int argc, char **argv)
Output the long usage message based on the provided options.
wv::function< bool(void *)> NoArgCallback
The callback type used for switches that do not take a parameter.