#include <options.h>
Public Member Functions | |
void | setValue (const typename T::value_type &a) |
T::value_type | value () const |
bool | boolValue () const |
int | intValue () const |
std::string | stringValue () const |
Protected Member Functions | |
SingleOption (const std::string &name) | |
SingleOption (const std::string &name, char shortName, const std::string &longName, const std::string &usage=std::string(), const std::string &description=std::string()) | |
ArgList::iterator | parse (ArgList &list, ArgList::iterator begin) |
Parse the next commandline parameter after the short form of the command has been found. | |
bool | parse (const std::string ¶m) |
Parse the commandline parameter of a long commandline switch. | |
Protected Attributes | |
T::value_type | m_value |
Friends | |
class | OptionGroup |
class | Engine |
wibble::commandline::SingleOption< T >::SingleOption | ( | const std::string & | name | ) | [inline, protected] |
wibble::commandline::SingleOption< T >::SingleOption | ( | const std::string & | name, | |
char | shortName, | |||
const std::string & | longName, | |||
const std::string & | usage = std::string() , |
|||
const std::string & | description = std::string() | |||
) | [inline, protected] |
ArgList::iterator wibble::commandline::SingleOption< T >::parse | ( | ArgList & | list, | |
ArgList::iterator | begin | |||
) | [inline, protected, virtual] |
Parse the next commandline parameter after the short form of the command has been found.
It may or may not remove the parameter from the list, depending on if the option wants a value or not.
Signal that the option has been found, with the given argument (or 0 if no argument).
Implements wibble::commandline::Option.
bool wibble::commandline::SingleOption< T >::parse | ( | const std::string & | param | ) | [inline, protected, virtual] |
Parse the commandline parameter of a long commandline switch.
Implements wibble::commandline::Option.
void wibble::commandline::SingleOption< T >::setValue | ( | const typename T::value_type & | a | ) | [inline] |
T::value_type wibble::commandline::SingleOption< T >::value | ( | ) | const [inline] |
Referenced by wibble::commandline::StandardParserWithManpage::parse().
bool wibble::commandline::SingleOption< T >::boolValue | ( | ) | const [inline] |
Referenced by TestCommandlineEngine::longOptsWithDashes(), TestCommandlineEngine::optsOnly(), and withCommands().
int wibble::commandline::SingleOption< T >::intValue | ( | ) | const [inline] |
std::string wibble::commandline::SingleOption< T >::stringValue | ( | ) | const [inline] |
friend class OptionGroup [friend] |
friend class Engine [friend] |
T::value_type wibble::commandline::SingleOption< T >::m_value [protected] |
Referenced by wibble::commandline::SingleOption< wibble::commandline::Int >::boolValue(), wibble::commandline::IntOption::IntOption(), wibble::commandline::SingleOption< wibble::commandline::Int >::intValue(), wibble::commandline::SingleOption< wibble::commandline::Int >::parse(), wibble::commandline::SingleOption< wibble::commandline::Int >::setValue(), wibble::commandline::SingleOption< wibble::commandline::Int >::stringValue(), and wibble::commandline::SingleOption< wibble::commandline::Int >::value().