40 #ifndef TF_COMMANDLINE_H_VERSION 42 #define TF_COMMANDLINE_H_VERSION \ 43 "TF_COMMANDLINE_H V1.5" 45 #include<tfxx/error.h> 212 bool optset(
const int& iopt)
const 250 if ((iopt < 0) || (iopt >=
Mnopt))
252 std::cerr <<
"Commandline: illegal option index '" 253 << iopt <<
"' on query" << std::endl;
299 #endif // TF_COMMANDLINE_H_ Result * Mresult
Array of command line contents.
int int_arg(const int &iopt) const
return argument of option # iopt as int value
bool opt_set
true if option was used on command line
void check_index(const int &iopt) const
Check requested index before query.
const char * opt_string
option name
option requires an argument
bool optset(const int &iopt) const
true if option # iopt was set on commandline
double double_arg(const int &iopt) const
return argument of option # iopt as double value
char ** Margv
Pointer to array of command line strings (as passed to main)
Eopt_arg_mode opt_arg_mode
option argument mode
bool bool_arg(const int &iopt) const
return argument of option # iopt as bool value
long long_arg(const int &iopt) const
return argument of option # iopt as long value
int Mnopt
Total number of options evaluated ot Mresult.
Commandline(int &iargc, char **argv, Declare *declarations)
Constructor evaluates commandline by calling long_getopt.
char * next()
returns char-array of next commandline argument
~Commandline()
Destructor has to remove result array.
int Miargc
Number of command line strings (as passed to main)
bool extra() const
true if there are more commandline arguments
Eopt_arg_mode
option modes ,The following enums are used to define whether an option has or has not an argument...
Structure to store result of command line scanning.
int Moptind
Next option string to read after last defined option.
Evaluates commandline by calling long_getopt. ,You may instantiate a Commandline object by passing th...
option may have an optional argument
const char * arg_default
option default argument
struct to define options ,This struct is used to define a list of options. An example is: ...
float float_arg(const int &iopt) const
return argument of option # iopt as float value
std::string arg
holds option argument
std::string string_arg(const int &iopt) const
return argument of option # iopt as string value
#define TFXX_abort(M)
Abort and give a message.
Namespace containing all code of library libtfxx.