wibble  1.1
Public Member Functions | Protected Member Functions | Friends | List of all members
wibble::commandline::BoolOption Class Reference

Boolean option. More...

#include <options.h>

Inheritance diagram for wibble::commandline::BoolOption:
Inheritance graph
[legend]
Collaboration diagram for wibble::commandline::BoolOption:
Collaboration graph
[legend]

Public Member Functions

bool boolValue () const
 
std::string stringValue () const
 
- Public Member Functions inherited from wibble::commandline::Option
 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
 
- Public Member Functions inherited from wibble::commandline::Managed
virtual ~Managed ()
 

Protected Member Functions

 BoolOption (const std::string &name)
 
 BoolOption (const std::string &name, char shortName, const std::string &longName, const std::string &usage=std::string(), const std::string &description=std::string())
 
virtual ArgList::iterator parse (ArgList &, ArgList::iterator begin)
 Parse the next commandline parameter after the short form of the command has been found. More...
 
virtual bool parse (const std::string &)
 Parse the commandline parameter of a long commandline switch. More...
 
virtual void parse_noarg ()
 Notify that the option is present in the command line, but has no arguments. More...
 
- Protected Member Functions inherited from wibble::commandline::Option
 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...
 

Friends

class OptionGroup
 
class Engine
 

Additional Inherited Members

- Public Attributes inherited from wibble::commandline::Option
std::vector< char > shortNames
 
std::vector< std::string > longNames
 
std::string usage
 
std::string description
 
bool hidden
 
- Protected Attributes inherited from wibble::commandline::Option
bool m_isset
 

Detailed Description

Boolean option.

Constructor & Destructor Documentation

wibble::commandline::BoolOption::BoolOption ( const std::string &  name)
inlineprotected
wibble::commandline::BoolOption::BoolOption ( const std::string &  name,
char  shortName,
const std::string &  longName,
const std::string &  usage = std::string(),
const std::string &  description = std::string() 
)
inlineprotected

Member Function Documentation

bool wibble::commandline::BoolOption::boolValue ( ) const
inline
virtual ArgList::iterator wibble::commandline::BoolOption::parse ( ArgList list,
ArgList::iterator  begin 
)
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).

Returns
true if it used the argument, else false

Implements wibble::commandline::Option.

References wibble::list::begin(), and parse_noarg().

virtual bool wibble::commandline::BoolOption::parse ( const std::string &  param)
inlineprotectedvirtual

Parse the commandline parameter of a long commandline switch.

Returns
true if the parameter has been used

Implements wibble::commandline::Option.

References parse_noarg().

virtual void wibble::commandline::BoolOption::parse_noarg ( )
inlineprotectedvirtual

Notify that the option is present in the command line, but has no arguments.

Implements wibble::commandline::Option.

References wibble::commandline::Option::m_isset.

Referenced by parse().

std::string wibble::commandline::BoolOption::stringValue ( ) const
inline

Friends And Related Function Documentation

friend class Engine
friend
friend class OptionGroup
friend

The documentation for this class was generated from the following file: