Image Component Library (ICL)
|
Programm argument utility class. More...
#include <ProgArg.h>
Public Member Functions | |
ICLUtils_API int | n () const |
returns the count of actually given sub arguments More... | |
ICLUtils_API Any | operator[] (int subArgIdx) const |
returns the given sub-argument in shape of an utils::Any More... | |
template<class T > | |
operator T () const | |
this is the main conversion function. It returns the associated sub argument as given T More... | |
bool | operator! () const |
negation operator More... | |
template<class T > | |
T | as () const |
this template function can be used to explicitly cast a program argument into a given type More... | |
std::string | operator * () const |
important convenience operator for using a ProgArg instance as string More... | |
const std::string & | getID () const |
returns the prog-arg id More... | |
Private Member Functions | |
ProgArg (const std::string &id, unsigned int subargidx) | |
private constructor More... | |
ProgArg (unsigned int idx, bool danglingOnly) | |
Programm argument utility class.
|
inlineprivate |
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
|
inlineprivate |
|
inline |
this template function can be used to explicitly cast a program argument into a given type
|
inline |
returns the prog-arg id
ICLUtils_API int icl::utils::ProgArg::n | ( | ) | const |
returns the count of actually given sub arguments
If this argument was not given, this function returns 0.
|
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.
|
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
|
inline |
negation operator
ICLUtils_API Any icl::utils::ProgArg::operator[] | ( | int | subArgIdx | ) | const |
returns the given sub-argument in shape of an utils::Any