wibble
1.1
|
#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 |
![]() | |
Option () | |
virtual | ~Option () |
bool | isSet () const |
const std::string & | name () const |
void | addAlias (char c) |
void | addAlias (const std::string &str) |
const std::string & | fullUsage () const |
Return a full usage message including all the aliases for this option. More... | |
std::string | fullUsageForMan () const |
![]() | |
virtual | ~Managed () |
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. More... | |
bool | parse (const std::string ¶m) |
Parse the commandline parameter of a long commandline switch. More... | |
void | parse_noarg () |
Notify that the option is present in the command line, but has no arguments. More... | |
![]() | |
Option (const std::string &name) | |
Option (const std::string &name, char shortName, const std::string &longName, const std::string &usage=std::string(), const std::string &description=std::string()) | |
virtual bool | arg_is_optional () const |
Return true if the argument to this function can be omitted. More... | |
Protected Attributes | |
T::value_type | m_value |
![]() | |
bool | m_isset |
Friends | |
class | OptionGroup |
class | Engine |
Additional Inherited Members | |
![]() | |
std::vector< char > | shortNames |
std::vector< std::string > | longNames |
std::string | usage |
std::string | description |
bool | hidden |
|
inlineprotected |
References wibble::commandline::Option::usage.
|
inlineprotected |
References wibble::commandline::Option::usage.
|
inline |
References wibble::commandline::SingleOption< T >::m_value.
Referenced by TestCommandlineEngine::longOptsWithDashes(), TestCommandlineEngine::optsOnly(), and withCommands().
|
inline |
References wibble::commandline::SingleOption< T >::m_value.
|
inlineprotectedvirtual |
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.
References wibble::list::begin(), wibble::commandline::ArgList::eraseAndAdvance(), wibble::commandline::Option::m_isset, and wibble::commandline::SingleOption< T >::m_value.
|
inlineprotectedvirtual |
Parse the commandline parameter of a long commandline switch.
Implements wibble::commandline::Option.
References wibble::commandline::Option::m_isset, and wibble::commandline::SingleOption< T >::m_value.
|
inlineprotectedvirtual |
Notify that the option is present in the command line, but has no arguments.
Implements wibble::commandline::Option.
|
inline |
References wibble::commandline::SingleOption< T >::m_value.
|
inline |
References wibble::commandline::SingleOption< T >::m_value.
Referenced by TestCommandlineEngine::clusteredShortOpts(), TestCommandlineEngine::commandsWithoutCommand(), TestCommandlineEngine::commandsWithOverlappingArgs(), TestCommandlineEngine::commandWithArg(), TestCommandlineEngine::longOptsWithArgs(), TestCommandlineEngine::noSwitchesAfterFirstArg(), and TestCommandlineEngine::optsAndArgs().
|
inline |
References wibble::commandline::SingleOption< T >::m_value.
|
friend |
|
friend |
|
protected |
Referenced by wibble::commandline::SingleOption< T >::boolValue(), wibble::commandline::SingleOption< T >::intValue(), wibble::commandline::SingleOption< T >::parse(), wibble::commandline::SingleOption< T >::setValue(), wibble::commandline::SingleOption< T >::stringValue(), and wibble::commandline::SingleOption< T >::value().