Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields  

sword::CommandLineOption< T > Class Template Reference

Option command line handler template class. More...

Inheritance diagram for sword::CommandLineOption< T >:

sword::CommandLineOptionBase

Public Types

typedef std::vector< T > Values

Public Methods

 CommandLineOption (CommandLineManager &manager, char shortName, const std::string &longName, const std::string &help, bool acceptMultiple, const T &value=T())
word size () const
 Number of values which were set for this option.

value (word i=0) const
 Get a value.

const Values & values () const
 Get all values as a std::vector<T>.

bool isSet () const
 has this option been set


Protected Methods

virtual void push_ (const std::string &value)
virtual void toggle_ (bool onOff)
void print_ (std::ostream &os, size_t ll) const

Protected Attributes

char shortName_
std::string longName_
std::string help_
bool acceptValue_
bool acceptMultiple_
bool gotOne_
bool used_
CommandLineManagermanager_

Detailed Description

template<typename T>
class sword::CommandLineOption< T >

Option command line handler template class.

Details about using this class are available in the CommandLineManager class.


Member Function Documentation

bool sword::CommandLineOptionBase::isSet   const [inherited]
 

has this option been set

A 'false' result does not necessarily means that no value is available, as the default value can also be retrieved.

template<typename T>
word sword::CommandLineOption< T >::size   const
 

Number of values which were set for this option.

template<typename T>
T sword::CommandLineOption< T >::value word    i = 0 const
 

Get a value.

template<typename T>
const Values& sword::CommandLineOption< T >::values   const
 

Get all values as a std::vector<T>.


Generated on Tue Dec 23 20:08:56 2003 for SWORD by doxygen1.3-rc2