10#include "wvstringlist.h"
348 void set_flag(
const flags_t flag,
const bool value);
WvArgs - Sane command-line argument processing for WvStreams.
void remove_option(char short_option)
Remove an option by specifying its short form.
void add_option(char short_option, WvStringParm long_option, WvStringParm desc, WvStringParm arg_desc, long &val)
Add a switch that takes a long argument.
void remove_all_options()
Remove all options.
void add_option(char short_option, WvStringParm long_option, WvStringParm desc, WvStringParm arg_desc, double &val)
Add a switch that takes a double argument.
bool get_flag(const flags_t flag) const
Get and set flags.
void add_option(char short_option, WvStringParm long_option, WvStringParm desc, WvStringParm arg_desc, float &val)
Add a switch that takes a float argument.
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 add_optional_arg(WvStringParm desc, bool multiple=false)
Add an optional argument to the list of parameters.
flags_t
These flags control the behaviour of WvArgs.
void set_help_header(WvStringParm header)
Set the introductory help message, printed at the beginning of –help.
void zap()
An alias for remove_all_options()
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 add_option(char short_option, WvStringParm long_option, WvStringParm desc, NoArgCallback cb, void *ud=NULL)
Add a switch which does not take an argument which invokes a callback when it is specified.
void print_usage(int argc, char **argv)
Output the short usage message based on the provided options.
void set_help_footer(WvStringParm footer)
Set the descriptive help message, printed at the end of –help.
wv::function< bool(void *)> NoArgCallback
The callback type used for switches that do not take a parameter.
void remove_option(WvStringParm long_option)
Remove an option by specifying its long form.
void add_option(char short_option, WvStringParm long_option, WvStringParm desc, WvStringParm arg_desc, ArgCallback cb, void *ud=NULL)
Add a switch which takes an argument which invokes a callback when it is specified.
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_required_arg(WvStringParm desc, bool multiple=false)
Add a required argument to the list of parameters.
void add_option(char short_option, WvStringParm long_option, WvStringParm desc, WvStringParm arg_desc, WvStringList &val)
Add a switch that takes a string argument; the argument is appended to a string list.
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.
void add_option(char short_option, WvStringParm long_option, WvStringParm desc, WvStringParm arg_desc, WvString &val)
Add a switch that takes a string argument.
void set_email(WvStringParm email)
Set the e-mail address for bug reports.
void print_help(int argc, char **argv)
Output the long usage message based on the provided 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_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.
A WvFastString acts exactly like a WvString, but can take (const char *) strings without needing to a...
This is a WvList of WvStrings, and is a really handy way to parse strings.
WvString is an implementation of a simple and efficient printable-string class.