#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] |
bool wibble::commandline::SingleOption< T >::boolValue | ( | ) | const [inline] |
Referenced by TestCommandlineEngine::longOptsWithDashes(), TestCommandlineEngine::optsOnly(), and withCommands().
int wibble::commandline::SingleOption< T >::intValue | ( | ) | const [inline] |
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.
Referenced by wibble::commandline::SingleOption< Int >::parse().
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] |
std::string wibble::commandline::SingleOption< T >::stringValue | ( | ) | const [inline] |
Referenced by TestCommandlineEngine::clusteredShortOpts(), TestCommandlineEngine::commandsWithoutCommand(), TestCommandlineEngine::commandsWithOverlappingArgs(), TestCommandlineEngine::commandWithArg(), TestCommandlineEngine::longOptsWithArgs(), TestCommandlineEngine::noSwitchesAfterFirstArg(), and TestCommandlineEngine::optsAndArgs().
T::value_type wibble::commandline::SingleOption< T >::value | ( | ) | const [inline] |
Referenced by wibble::commandline::StandardParserWithManpage::parse().
friend class Engine [friend] |
Reimplemented from wibble::commandline::Option.
Reimplemented in wibble::commandline::IntOption.
friend class OptionGroup [friend] |
Reimplemented from wibble::commandline::Option.
Reimplemented in wibble::commandline::IntOption.
T::value_type wibble::commandline::SingleOption< T >::m_value [protected] |
Referenced by wibble::commandline::SingleOption< Int >::boolValue(), wibble::commandline::SingleOption< Int >::intValue(), wibble::commandline::SingleOption< Int >::parse(), wibble::commandline::SingleOption< Int >::setValue(), wibble::commandline::SingleOption< Int >::stringValue(), and wibble::commandline::SingleOption< Int >::value().