Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

mpcl::util::prefs::TOption Class Reference

#include <option.hh>

Inheritance diagram for mpcl::util::prefs::TOption:

mpcl::io::IOutputStreamable< TChar, TTraits > List of all members.

Public Methods

 TOption (void)
 Build a new instance.

 TOption (const TOption &rktSOURCE_OPTION)
 TOption (const TString &rkyNAME, const TString &rkySHORTCUT)
 TOption (const TString &rkyNAME, const TString &rkySHORTCUT, const TString &rkyDEFAULT_VALUE)
virtual ~TOption (void)
 Destroys the instance.

void addValue (const TString &rkyVALUE)
TOption & operator= (const TOption &rktSOURCE_OPTION)
 Copies rktSOURCE_OPTION onto this instance.

void setCmdLinePresence (void)
 Obliges this option to appear in command-line.

void setUsageString (const TString &rkyVALUE)
void setValue (const TString &rkyVALUE)
const TString & getValue (void) const throw (TNotParameterAbleException)
const std::vector< TString > & getValues (void) const throw (TNotParameterAbleException)
bool hasValue (const TString &rkySOURCE_VALUE) const
TString help (void) const
bool isAtCmdLine (void) const
bool isEmpty (void) const
bool isParameterAble (void) const
TString name (void) const
const TString & operator[] (size_type zINDEX) const
TString & operator[] (size_type zINDEX)
bool operator== (const TOption &rktSOURCE_OPTION) const
TString shortcut (void) const
size_type valueCount (void) const

Protected Methods

void write (std::basic_ostream< char_type, traits_type > &rtTARGET_OSTREAM) const

Detailed Description

Option for configuration processor.
See also:
TConfigProcessor.

Definition at line 55 of file util/prefs/option.hh.


Constructor & Destructor Documentation

mpcl::util::prefs::TOption::TOption const TOption &    rktSOURCE_OPTION [inline]
 

Build a new instance from another.

Parameters:
rktSOURCE_OPTION  Source instance.

Definition at line 121 of file util/prefs/option.hh.

mpcl::util::prefs::TOption::TOption const TString &    rkyNAME,
const TString &    rkySHORTCUT
[inline]
 

Builds a new instance. Now this is an option with no value.

Parameters:
rkyNAME  Source name.
rkySHORTCUT  Shortcut of the option.

Definition at line 136 of file util/prefs/option.hh.

References mpcl::text::TString.

mpcl::util::prefs::TOption::TOption const TString &    rkyNAME,
const TString &    rkySHORTCUT,
const TString &    rkyDEFAULT_VALUE
[inline]
 

Builds a new instance. Now this is an option that can contain a value.

Parameters:
rkyNAME  Source name.
rkySHORTCUT  Shortcut of the option.
rkyDEFAULT_VALUE  Default value.

Definition at line 152 of file util/prefs/option.hh.

References mpcl::text::TString.


Member Function Documentation

void mpcl::util::prefs::TOption::addValue const TString &    rkyVALUE [inline]
 

Adds rkyVALUE as the last value of this instance.

Parameters:
rkyVALUE  Value to add.

Definition at line 171 of file util/prefs/option.hh.

References mpcl::text::TString.

Referenced by setValue().

const TString& mpcl::util::prefs::TOption::getValue void    const throw (TNotParameterAbleException) [inline]
 

Get last value in value collection.

Returns:
Last value.

Definition at line 232 of file util/prefs/option.hh.

References mpcl::text::TString.

const std::vector<TString>& mpcl::util::prefs::TOption::getValues void    const throw (TNotParameterAbleException) [inline]
 

Gets a vector with input values (from command-line, or from standard input).

Returns:
All values.

Definition at line 247 of file util/prefs/option.hh.

bool mpcl::util::prefs::TOption::hasValue const TString &    rkySOURCE_VALUE const
 

Returns true if it has rkySOURCE_VALUE as value.

Parameters:
rkySOURCE_VALUE  Source value.
Returns:
True if it has rkySOURCE_VALUE as value.

Definition at line 41 of file option.cc.

References mpcl::text::TString.

TString mpcl::util::prefs::TOption::help void    const [inline]
 

Get help string

Returns:
Help.

Definition at line 268 of file util/prefs/option.hh.

References mpcl::text::TString.

bool mpcl::util::prefs::TOption::isAtCmdLine void    const [inline]
 

Returns true if option is at command line.

Returns:
True if option is at command line.

Definition at line 277 of file util/prefs/option.hh.

bool mpcl::util::prefs::TOption::isEmpty void    const [inline]
 

Returns true if it has no value from any source.

Returns:
True if it has no value from any source.

Definition at line 286 of file util/prefs/option.hh.

bool mpcl::util::prefs::TOption::isParameterAble void    const [inline]
 

Returns true if option can have parameters.

Returns:
True if option can have parameters.

Definition at line 295 of file util/prefs/option.hh.

TString mpcl::util::prefs::TOption::name void    const [inline]
 

Get name.

Returns:
Name.

Definition at line 304 of file util/prefs/option.hh.

References mpcl::text::TString.

bool mpcl::util::prefs::TOption::operator== const TOption &    rktSOURCE_OPTION const [inline]
 

Returns true if this instance and rktSOURCE_OPTION have equal value. This method is required by container classes.

Parameters:
rktSOURCE_OPTION  Source instance.
Returns:
True if this instance and rktSOURCE_OPTION have equal value.

Definition at line 335 of file util/prefs/option.hh.

References yName.

TString& mpcl::util::prefs::TOption::operator[] size_type    zINDEX [inline]
 

Gets value at position zINDEX.

Parameters:
zINDEX  Index.
Returns:
Value at position zINDEX.

Definition at line 324 of file util/prefs/option.hh.

References mpcl::text::TString.

const TString& mpcl::util::prefs::TOption::operator[] size_type    zINDEX const [inline]
 

Gets value at position zINDEX.

Parameters:
zINDEX  Index.
Returns:
Value at position zINDEX.

Definition at line 314 of file util/prefs/option.hh.

References mpcl::text::TString.

void mpcl::util::prefs::TOption::setUsageString const TString &    rkyVALUE [inline]
 

Sets rkyVALUE as the help string associated to this option.

Parameters:
rkyVALUE  Help string.

Definition at line 206 of file util/prefs/option.hh.

References mpcl::text::TString.

void mpcl::util::prefs::TOption::setValue const TString &    rkyVALUE [inline]
 

Sets rkyVALUE as the unique value of this instance.

Parameters:
rkyVALUE  Value to assign.

Definition at line 215 of file util/prefs/option.hh.

References addValue(), and mpcl::text::TString.

TString mpcl::util::prefs::TOption::shortcut void    const [inline]
 

Get short name alias for command-line.

Returns:
Shortcut.

Definition at line 344 of file util/prefs/option.hh.

References mpcl::text::TString.

size_type mpcl::util::prefs::TOption::valueCount void    const [inline]
 

Gets number of values.

Returns:
Value count.

Definition at line 353 of file util/prefs/option.hh.

void mpcl::util::prefs::TOption::write std::basic_ostream< char_type, traits_type > &    rtTARGET_OSTREAM const [protected, virtual]
 

Writes the instance onto stream rtTARGET_STREAM.

Parameters:
rtTARGET_STREAM  Target output stream.

Implements mpcl::io::IOutputStreamable< TChar, TTraits >.

Definition at line 64 of file option.cc.


The documentation for this class was generated from the following files:
Generated on Mon Oct 13 02:35:27 2003 for MPCL by doxygen1.2.18