Inherits util::Option.
List of all members.
Public Member Functions
- StringArrayOption (const char *name, const char *defaultVal, const char *usage, const char &cmd, const int &N, string *const storage=NULL)
- StringArrayOption (const string &name, const string &defaultVal, const string &usage, const char &cmd, const int &N, string *const storage=NULL)
- StringArrayOption (const StringArrayOption &other)
- ~StringArrayOption () throw ()
- virtual string getTypeName () const
- Return the type name of the option as a string.
- void setValue (const string &s) throw (UException)
- This function is the heart of the
Option
class: it parses the value of the option from the supplied string
.
- virtual string * getStringArray () const
- virtual string toString () const
- Return the option's value as a string.
- virtual bool needsValue () const
- const string & getName () const
- Return the (long) option name.
- char getCmdLineChar () const
- Return the short option char.
- const string & getDefault () const
- Return the string representation of the default value.
- const string & getUsage () const
- Return the help string.
|
|
Protected Attributes
- const int N_
- string *const storage_
- string *const value_
- string name_
- long option name (e.g. --long-option or long-option=value)
- string default_
- string representation of default value
- string usage_
- help string
- char cmdlinechar_
- short option char, for command line use
Related Functions
(Note that these are not member functions.)
Constructor & Destructor Documentation
util::StringArrayOption::StringArrayOption |
( |
const char * |
name, |
|
|
const char * |
defaultVal, |
|
|
const char * |
usage, |
|
|
const char & |
cmd, |
|
|
const int & |
N, |
|
|
string *const |
storage = NULL | |
|
) |
| | |
util::StringArrayOption::StringArrayOption |
( |
const string & |
name, |
|
|
const string & |
defaultVal, |
|
|
const string & |
usage, |
|
|
const char & |
cmd, |
|
|
const int & |
N, |
|
|
string *const |
storage = NULL | |
|
) |
| | |
util::StringArrayOption::~StringArrayOption |
( |
|
) |
throw () |
Member Function Documentation
virtual string util::StringArrayOption::getTypeName |
( |
|
) |
const [inline, virtual] |
Return the type name of the option as a string.
Reimplemented from util::Option.
void util::StringArrayOption::setValue |
( |
const string & |
s |
) |
throw (UException) [virtual] |
This function is the heart of the Option
class: it parses the value of the option from the supplied string
.
Implements util::Option.
virtual string* util::StringArrayOption::getStringArray |
( |
|
) |
const [virtual] |
virtual string util::StringArrayOption::toString |
( |
|
) |
const [virtual] |
Return the option's value as a string.
Implements util::Option.
virtual int util::Option::getInt |
( |
|
) |
const [inline, virtual, inherited] |
Acess the value of the option. Usually subclasses will not implement all of these, in fact, mostly just one of these.
Reimplemented in util::IntOption.
virtual float util::Option::getFloat |
( |
|
) |
const [inline, virtual, inherited] |
virtual string util::Option::getString |
( |
|
) |
const [inline, virtual, inherited] |
virtual bool util::Option::getBool |
( |
|
) |
const [inline, virtual, inherited] |
virtual bool util::Option::needsValue |
( |
|
) |
const [inline, virtual, inherited] |
Return true
if the option needs a value, false
if it is a toggle-switch needing no value. On the command line, values are given as --long-option value, or -x value. In a config file, long-option = value. '#' can be used to delineate comments. See CommandLineReader
and ConfigFileReader
.
Reimplemented in util::BoolOption.
const string& util::Option::getName |
( |
|
) |
const [inherited] |
Return the (long) option name.
char util::Option::getCmdLineChar |
( |
|
) |
const [inherited] |
Return the short option char.
const string& util::Option::getDefault |
( |
|
) |
const [inherited] |
Return the string representation of the default value.
const string& util::Option::getUsage |
( |
|
) |
const [inherited] |
Member Data Documentation
long option name (e.g. --long-option or long-option=value)
string representation of default value
short option char, for command line use