library of assembled shared sources |
http://lass.cocamware.com |
#include <arg_parser.h>
Public Types | |
typedef util::CallTraits< T > ::TValue | TValue |
typedef util::CallTraits< T > ::TParam | TParam |
typedef util::CallTraits< T > ::TConstReference | TConstReference |
typedef std::vector< TValue > | TValues |
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 TValues & | all () 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_ |
Definition at line 202 of file arg_parser.h.
typedef util::CallTraits<T>::TValue lass::io::ArgValue< T >::TValue |
Definition at line 206 of file arg_parser.h.
typedef util::CallTraits<T>::TParam lass::io::ArgValue< T >::TParam |
Definition at line 207 of file arg_parser.h.
typedef util::CallTraits<T>::TConstReference lass::io::ArgValue< T >::TConstReference |
Definition at line 208 of file arg_parser.h.
typedef std::vector<TValue> lass::io::ArgValue< T >::TValues |
Definition at line 209 of file arg_parser.h.
typedef TValues::const_iterator lass::io::ArgValue< T >::TValueIterator |
Definition at line 210 of file arg_parser.h.
lass::io::ArgValue< T >::ArgValue | ( | ArgParser & | iParser, | |
const std::string & | iShortName, | |||
const std::string & | iLongName, | |||
const std::string & | iDescription = "" , |
|||
int | iArgMode = amDefault | |||
) | [inline] |
lass::io::ArgValue< T >::ArgValue | ( | ArgParser & | iParser, | |
const std::string & | iShortName, | |||
const std::string & | iLongName, | |||
const std::string & | iDescription, | |||
int | iArgMode, | |||
TParam | iDefault | |||
) | [inline] |
lass::io::ArgValue< T >::ArgValue | ( | ArgParser & | iParser, | |
const ArgFormat & | iFormat | |||
) | [inline] |
Definition at line 89 of file arg_parser.inl.
References lass::io::ArgFormat::argMode, lass::io::ArgValue< T >::checkMode(), lass::io::ArgValue< T >::default_, lass::io::ArgFormat::defaultValue, and lass::io::ArgFormat::hasDefault.
const ArgValue< T >::TValues & lass::io::ArgValue< T >::all | ( | ) | const [inline] |
return all values
Definition at line 106 of file arg_parser.inl.
References lass::io::ArgValue< T >::default_, and lass::io::ArgValue< T >::values_.
Referenced by lass::io::ArgValue< T >::at(), lass::io::ArgValue< T >::begin(), lass::io::ArgValue< T >::end(), lass::io::ArgValue< T >::operator[](), and lass::io::ArgValue< T >::size().
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[]().
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().
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().
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().
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().
const std::string lass::io::ArgValue< T >::doFormat | ( | ) | const [inline, private, virtual] |
Reimplemented from lass::io::ArgParameter.
Definition at line 186 of file arg_parser.inl.
References lass::io::amMultiple, lass::io::amNoValue, lass::io::amOptional, lass::io::ArgValue< T >::description_, LASS_ASSERT, lass::io::ArgParameter::mode(), and lass::io::ArgParameter::names().
const bool lass::io::ArgValue< T >::doSetValue | ( | const std::string & | iValue | ) | [inline, private, virtual] |
Reimplemented from lass::io::ArgParameter.
Definition at line 214 of file arg_parser.inl.
References lass::io::amMultiple, lass::io::amNoValue, lass::io::amRequired, LASS_ASSERT, LASS_THROW_EX, lass::io::ArgParameter::mode(), lass::io::ArgParameter::names(), lass::io::ArgParameter::parserIsQuiet(), lass::stde::T, and lass::io::ArgValue< T >::values_.
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] |
Definition at line 570 of file arg_parser.cpp.
References lass::io::ArgParameter::shortName_.
Referenced by lass::io::ArgParser::parseShort(), and lass::io::ArgParser::subscribe().
const std::string & lass::io::ArgParameter::longName | ( | ) | const [inherited] |
Definition at line 577 of file arg_parser.cpp.
References lass::io::ArgParameter::longName_.
Referenced by lass::io::ArgParser::parseLong(), and lass::io::ArgParser::subscribe().
const int lass::io::ArgParameter::mode | ( | ) | const [inherited] |
Definition at line 584 of file arg_parser.cpp.
References lass::io::ArgParameter::mode_.
Referenced by lass::io::ArgValue< T >::doFormat(), lass::io::ArgValue< T >::doSetValue(), and lass::io::ArgParser::parseShort().
const std::string lass::io::ArgParameter::format | ( | ) | const [inherited] |
bool lass::io::ArgParameter::operator! | ( | ) | const [inherited] |
lass::io::ArgParameter::operator num::SafeBool | ( | ) | const [inherited] |
Definition at line 598 of file arg_parser.cpp.
References lass::io::ArgParameter::isSet_, lass::num::safeFalse, and lass::num::safeTrue.
const std::string lass::io::ArgParameter::names | ( | ) | const [protected, inherited] |
Definition at line 620 of file arg_parser.cpp.
References lass::io::ArgParameter::longName_, and lass::io::ArgParameter::shortName_.
Referenced by lass::io::ArgValue< T >::checkMode(), lass::io::ArgValue< T >::doFormat(), lass::io::ArgParameter::doFormat(), and lass::io::ArgValue< T >::doSetValue().
const bool lass::io::ArgParameter::parserIsQuiet | ( | ) | const [protected, inherited] |
Definition at line 642 of file arg_parser.cpp.
References lass::io::ArgParser::isQuiet_, and lass::io::ArgParameter::parser_.
Referenced by lass::io::ArgValue< T >::doSetValue().
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] |
TValues lass::io::ArgValue< T >::values_ [private] |
Definition at line 241 of file arg_parser.h.
Referenced by lass::io::ArgValue< T >::all(), and lass::io::ArgValue< T >::doSetValue().
TValues lass::io::ArgValue< T >::default_ [private] |
Definition at line 242 of file arg_parser.h.
Referenced by lass::io::ArgValue< T >::all(), and lass::io::ArgValue< T >::ArgValue().
std::string lass::io::ArgValue< T >::description_ [private] |
Generated on Mon Nov 10 14:22:09 2008 for Library of Assembled Shared Sources by 1.5.7.1 |