Tagcoll::commandline::Option Class Reference

Interface for a parser for one commandline option. More...

#include <Commandline.h>

Inheritance diagram for Tagcoll::commandline::Option:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 Option (const std::string &name)
 Option (const std::string &name, char shortName, const std::string &longName)
virtual ~Option ()
const std::string & name () const
void addAlias (char c)
void addAlias (const std::string &str)
virtual bool boolValue () const =0
virtual std::string stringValue () const =0
virtual int intValue () const
virtual bool parse (const char *str=0)=0
 Signal that the option has been found, with the given argument (or 0 if no argument).
const std::string & fullUsage () const
 Return a full usage message including all the aliases for this option.
std::string fullUsageForMan () const

Public Attributes

std::vector< char > shortNames
std::vector< std::string > longNames
std::string usage
std::string description

Detailed Description

Interface for a parser for one commandline option.


Constructor & Destructor Documentation

Tagcoll::commandline::Option::Option const std::string &  name  )  [inline]
 

Tagcoll::commandline::Option::Option const std::string &  name,
char  shortName,
const std::string &  longName
[inline]
 

virtual Tagcoll::commandline::Option::~Option  )  [inline, virtual]
 


Member Function Documentation

void Tagcoll::commandline::Option::addAlias const std::string &  str  )  [inline]
 

void Tagcoll::commandline::Option::addAlias char  c  )  [inline]
 

virtual bool Tagcoll::commandline::Option::boolValue  )  const [pure virtual]
 

Implemented in Tagcoll::commandline::BoolOption, Tagcoll::commandline::StringOption, Tagcoll::commandline::IntOption, and Tagcoll::commandline::ExistingFileOption.

const std::string & Tagcoll::commandline::Option::fullUsage  )  const
 

Return a full usage message including all the aliases for this option.

std::string Tagcoll::commandline::Option::fullUsageForMan  )  const
 

int Tagcoll::commandline::Option::intValue  )  const [virtual]
 

Reimplemented in Tagcoll::commandline::IntOption.

const std::string& Tagcoll::commandline::Option::name  )  const [inline]
 

virtual bool Tagcoll::commandline::Option::parse const char *  str = 0  )  [pure virtual]
 

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

Implemented in Tagcoll::commandline::BoolOption, Tagcoll::commandline::StringOption, Tagcoll::commandline::IntOption, and Tagcoll::commandline::ExistingFileOption.

virtual std::string Tagcoll::commandline::Option::stringValue  )  const [pure virtual]
 

Implemented in Tagcoll::commandline::BoolOption, Tagcoll::commandline::StringOption, Tagcoll::commandline::IntOption, and Tagcoll::commandline::ExistingFileOption.


Member Data Documentation

std::string Tagcoll::commandline::Option::description
 

std::vector<std::string> Tagcoll::commandline::Option::longNames
 

std::vector<char> Tagcoll::commandline::Option::shortNames
 

std::string Tagcoll::commandline::Option::usage
 


The documentation for this class was generated from the following files:
Generated on Mon Jun 19 17:32:50 2006 for libtagcoll by  doxygen 1.4.6