The base class for all options.
More...
#include <option.h>
Inheritance diagram for util::Option:
List of all members.Public Member Functions
-
Option (const char *name, const char *defaultVal, const char *usage, const char cmd)
-
Option (const string &name, const string &defaultVal, const string &usage, const char cmd)
-
virtual void setValue (const string &s)=0 throw (UException)
-
virtual int getInt () const
-
virtual float getFloat () const
-
virtual string getString () const
-
virtual bool getBool () const
-
virtual string getTypeName () const
-
virtual bool needsValue () const
-
const string & getName () const
-
char getCmdLineChar () const
-
const string & getDefault () const
-
const string & getUsage () const
-
virtual string toString () const =0
Protected Attributes
-
string name_
-
string default_
-
string usage_
-
char cmdlinechar_
Related Functions
(Note that these are not member functions.)
Detailed Description
The base class for all options.
All data is stored as strings. Conversion (parsing) to the actual type happens in derived specializations.
Constructing an option requires 4 (+1) parameters:
- the option's name
- the default value as a string
- the help string to print for this option
- the character representing the option in the command line '-x' if this char is 0, the option will be a long option with it's name used as the option string for the command line '--name'
- The constructors of the heirs have a further parameter which is a pointer to the option's type. The option will also write its value to that location if the pointer is not NULL;
The documentation for this class was generated from the following file:
Generated on Fri Dec 24 13:32:05 2004 for LTL by
1.3.4