Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions
icl::utils::ProgArg Class Reference

Programm argument utility class. More...

#include <ProgArg.h>

List of all members.

Public Member Functions

int n () const throw (ProgArgException)
 returns the count of actually given sub arguments
Any operator[] (int subArgIdx) const throw (ProgArgException)
 returns the given sub-argument in shape of an utils::Any
template<class T >
 operator T () const throw (ProgArgException)
 this is the main conversion function. It returns the associated sub argument as given T
template<class T >
as () const throw (ProgArgException)
 this template function can be used to explicitly cast a program argument into a given type
std::string operator* () const throw (ProgArgException)
 important convenience operator for using a ProgArg instance as string
const std::string & getID () const
 returns the prog-arg id

Private Member Functions

 ProgArg (const std::string &id, unsigned int subargidx)
 private constructor
 ProgArg (unsigned int idx, bool danglingOnly)

Detailed Description

Programm argument utility class.

See also:
icl::pa(const std::string&,unsigned int)

Constructor & Destructor Documentation

icl::utils::ProgArg::ProgArg ( const std::string &  id,
unsigned int  subargidx 
) [inline, private]

private constructor

Use the functions icl::utils::pa(const std::string&,unsigned int) and icl::utils::pa(unsigned int,bool) to create an instance of this class in order to access program arguments

icl::utils::ProgArg::ProgArg ( unsigned int  idx,
bool  danglingOnly 
) [inline, private]

Member Function Documentation

template<class T >
T icl::utils::ProgArg::as ( ) const throw (ProgArgException) [inline]

this template function can be used to explicitly cast a program argument into a given type

const std::string& icl::utils::ProgArg::getID ( ) const [inline]

returns the prog-arg id

returns the count of actually given sub arguments

If this argument was not given, this function returns 0.

template<class T >
icl::utils::ProgArg::operator T ( ) const throw (ProgArgException) [inline]

this is the main conversion function. It returns the associated sub argument as given T

If T is bool, this operator returns whether the arg was given rather than its value

std::string icl::utils::ProgArg::operator* ( ) const throw (ProgArgException) [inline]

important convenience operator for using a ProgArg instance as string

*pa("-x") is the same as pa("-x").as<std::string>(). However, the first version is much shorter.

Any icl::utils::ProgArg::operator[] ( int  subArgIdx) const throw (ProgArgException)

returns the given sub-argument in shape of an utils::Any


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines