library of assembled shared sources

http://lass.cocamware.com

lass::io::ArgValue< T > Class Template Reference
[ArgParser]

#include <arg_parser.h>

Inheritance diagram for lass::io::ArgValue< T >:

Inheritance graph
[legend]
Collaboration diagram for lass::io::ArgValue< T >:

Collaboration graph
[legend]

Public Types

typedef util::CallTraits< T >
::TValue 
TValue
typedef util::CallTraits< T >
::TParam 
TParam
typedef util::CallTraits< T >
::TConstReference 
TConstReference
typedef std::vector< TValueTValues
typedef TValues::const_iterator TValueIterator

Public Member Functions

 ArgValue (ArgParser &iParser, const std::string &iShortName, const std::string &iLongName, const std::string &iDescription="", int iArgMode=amDefault)
 ArgValue (ArgParser &iParser, const std::string &iShortName, const std::string &iLongName, const std::string &iDescription, int iArgMode, TParam iDefault)
 ArgValue (ArgParser &iParser, const ArgFormat &iFormat)
const TValuesall () const
 return all values
size_t size () const
 return number of values that are stored for this argument.
ArgValue::TConstReference operator[] (size_t iIndex) const
 return iIndex'ed value.
ArgValue::TConstReference at (size_t iIndex) const
 return iIndex'ed value with range check
TValueIterator begin () const
 return iterator to first value
TValueIterator end () const
 return iterator to last value
const std::string & shortName () const
const std::string & longName () const
const int mode () const
const std::string format () const
bool operator! () const
 operator num::SafeBool () const

Protected Member Functions

const std::string names () const
const bool parserIsQuiet () const
const bool setValue (const std::string &iValue)
void set ()

Private Member Functions

virtual const std::string doFormat () const
virtual const bool doSetValue (const std::string &iValue)
void checkMode (int iArgMode) const
 check if mode is valid amNoValue can't be set, and exactly one of amOptional or amRequired must be set.

Private Attributes

TValues values_
TValues default_
std::string description_

Detailed Description

template<typename T>
class lass::io::ArgValue< T >

Definition at line 202 of file arg_parser.h.


Member Typedef Documentation

template<typename T >
typedef util::CallTraits<T>::TValue lass::io::ArgValue< T >::TValue

Definition at line 206 of file arg_parser.h.

template<typename T >
typedef util::CallTraits<T>::TParam lass::io::ArgValue< T >::TParam

Definition at line 207 of file arg_parser.h.

template<typename T >
typedef util::CallTraits<T>::TConstReference lass::io::ArgValue< T >::TConstReference

Definition at line 208 of file arg_parser.h.

template<typename T >
typedef std::vector<TValue> lass::io::ArgValue< T >::TValues

Definition at line 209 of file arg_parser.h.

template<typename T >
typedef TValues::const_iterator lass::io::ArgValue< T >::TValueIterator

Definition at line 210 of file arg_parser.h.


Constructor & Destructor Documentation

template<typename T >
lass::io::ArgValue< T >::ArgValue ( ArgParser iParser,
const std::string &  iShortName,
const std::string &  iLongName,
const std::string &  iDescription = "",
int  iArgMode = amDefault 
) [inline]

Definition at line 59 of file arg_parser.inl.

References lass::io::ArgValue< T >::checkMode().

template<typename T >
lass::io::ArgValue< T >::ArgValue ( ArgParser iParser,
const std::string &  iShortName,
const std::string &  iLongName,
const std::string &  iDescription,
int  iArgMode,
TParam  iDefault 
) [inline]

Definition at line 73 of file arg_parser.inl.

References lass::io::ArgValue< T >::checkMode().

template<typename T >
lass::io::ArgValue< T >::ArgValue ( ArgParser iParser,
const ArgFormat iFormat 
) [inline]


Member Function Documentation

template<typename T >
const ArgValue< T >::TValues & lass::io::ArgValue< T >::all (  )  const [inline]

template<typename T >
size_t lass::io::ArgValue< T >::size (  )  const [inline]

return number of values that are stored for this argument.

Definition at line 116 of file arg_parser.inl.

References lass::io::ArgValue< T >::all().

Referenced by lass::io::ArgValue< T >::operator[]().

template<typename T >
ArgValue< T >::TConstReference lass::io::ArgValue< T >::operator[] ( size_t  iIndex  )  const [inline]

return iIndex'ed value.

Definition at line 126 of file arg_parser.inl.

References lass::io::ArgValue< T >::all(), LASS_ASSERT, and lass::io::ArgValue< T >::size().

template<typename T >
ArgValue< T >::TConstReference lass::io::ArgValue< T >::at ( size_t  iIndex  )  const [inline]

return iIndex'ed value with range check

Definition at line 137 of file arg_parser.inl.

References lass::io::ArgValue< T >::all().

template<typename T >
ArgValue< T >::TValueIterator lass::io::ArgValue< T >::begin (  )  const [inline]

return iterator to first value

Definition at line 147 of file arg_parser.inl.

References lass::io::ArgValue< T >::all().

template<typename T >
ArgValue< T >::TValueIterator lass::io::ArgValue< T >::end (  )  const [inline]

return iterator to last value

Definition at line 157 of file arg_parser.inl.

References lass::io::ArgValue< T >::all().

template<typename T >
const std::string lass::io::ArgValue< T >::doFormat (  )  const [inline, private, virtual]

template<typename T >
const bool lass::io::ArgValue< T >::doSetValue ( const std::string &  iValue  )  [inline, private, virtual]

template<typename T >
void lass::io::ArgValue< T >::checkMode ( int  iArgMode  )  const [inline, private]

check if mode is valid amNoValue can't be set, and exactly one of amOptional or amRequired must be set.

Definition at line 168 of file arg_parser.inl.

References lass::io::amNoValue, lass::io::amOptional, lass::io::amRequired, lass::meta::tuple::field(), LASS_THROW, and lass::io::ArgParameter::names().

Referenced by lass::io::ArgValue< T >::ArgValue().

const std::string & lass::io::ArgParameter::shortName (  )  const [inherited]

const std::string & lass::io::ArgParameter::longName (  )  const [inherited]

const int lass::io::ArgParameter::mode (  )  const [inherited]

const std::string lass::io::ArgParameter::format (  )  const [inherited]

Definition at line 656 of file arg_parser.cpp.

References lass::io::ArgParameter::doFormat().

bool lass::io::ArgParameter::operator! (  )  const [inherited]

Definition at line 591 of file arg_parser.cpp.

References lass::io::ArgParameter::isSet_.

lass::io::ArgParameter::operator num::SafeBool (  )  const [inherited]

const std::string lass::io::ArgParameter::names (  )  const [protected, inherited]

const bool lass::io::ArgParameter::parserIsQuiet (  )  const [protected, inherited]

const bool lass::io::ArgParameter::setValue ( const std::string &  iValue  )  [protected, inherited]

Definition at line 663 of file arg_parser.cpp.

References lass::io::ArgParameter::doSetValue().

Referenced by lass::io::ArgParser::parseShort().

void lass::io::ArgParameter::set (  )  [protected, inherited]

Definition at line 649 of file arg_parser.cpp.

References lass::io::ArgParameter::isSet_.


Field Documentation

template<typename T >
TValues lass::io::ArgValue< T >::values_ [private]

template<typename T >
TValues lass::io::ArgValue< T >::default_ [private]

template<typename T >
std::string lass::io::ArgValue< T >::description_ [private]

Definition at line 243 of file arg_parser.h.

Referenced by lass::io::ArgValue< T >::doFormat().


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

Generated on Mon Nov 10 14:22:09 2008 for Library of Assembled Shared Sources by doxygen 1.5.7.1
SourceForge.net Logo