58 typedef std::string::size_type size_type ;
60 GetOpt(
const Arg & arg ,
const std::string & spec ) ;
97 void showErrors( std::ostream & stream , std::string prefix_1 ,
98 std::string prefix_2 = std::string(
": ") )
const ;
103 void showErrors( std::ostream & stream )
const ;
106 bool contains(
char option_letter )
const ;
110 bool contains(
const std::string & option_name )
const ;
114 unsigned int count(
const std::string & option_name )
const ;
117 std::string
value(
const std::string & option_name ,
const std::string & default_ = std::string() )
const ;
121 std::string
value(
char option_letter ,
const std::string & default_ = std::string() )
const ;
127 void operator=(
const GetOpt & ) ;
129 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).
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...
A map-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.
unsigned int count(const std::string &option_name) const
Returns the number of times the option was supplied.
const Options & options() const
Returns a reference to the internal option specification 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.