58 typedef std::string::size_type size_type ;
60 GetOpt(
const Arg & arg ,
const std::string & spec ) ;
100 void showErrors( std::ostream & stream , std::string prefix_1 ,
101 std::string prefix_2 = std::string(
": ") )
const ;
106 void showErrors( std::ostream & stream )
const ;
109 bool contains(
char option_letter )
const ;
113 bool contains(
const std::string & option_name )
const ;
117 size_t count(
const std::string & option_name )
const ;
120 std::string
value(
const std::string & option_name ,
const std::string & default_ = std::string() )
const ;
124 std::string
value(
char option_letter ,
const std::string & default_ = std::string() )
const ;
131 void operator=(
const GetOpt & ) ;
133 void parseArgs(
Arg & ) ;
void showErrors(std::ostream &stream, std::string prefix_1, std::string prefix_2=std::string(": ")) const
A convenience function which streams out each errorList() item to the given stream, prefixed with the given prefix(es).
size_t count(const std::string &option_name) const
Returns the number of times the option was supplied.
StringArray errorList() const
Returns the list of errors.
bool hasErrors() const
Returns true if there are errors.
std::vector< std::string > StringArray
A std::vector of std::strings.
A parser for command-line arguments that operates according to an Options specification and returns a...
const OptionMap & map() const
Returns a reference to the OptionMap sub-object.
A multimap-like container for command-line options and their values.
void addOptionsFromFile(size_type n=1U)
Adds options from the config file named by the n'th non-option command-line argument (zero-based but ...
A command line option parser.
Arg args() const
Returns all the non-option command-line arguments.
const Options & options() const
Returns a reference to the option specification sub-object.
GetOpt(const Arg &arg, const std::string &spec)
Constructor taking a Arg reference and a G::Options specification string.
std::string value(const std::string &option_name, const std::string &default_=std::string()) const
Returns the value related to the option identified by its long-form name.
A class which holds a represention of the argc/argv command line array, and supports simple command-l...
bool contains(char option_letter) const
Returns true if the command line contains the option identified by its short-form letter...
void reload(const StringArray &arg)
Reinitialises the object with the given command-line arguments.
A class to represent allowed command-line options and to provide command-line usage text...
A Path object represents a file system path.