#include <uconf.hpp>
Static Public Member Functions | |
| static class UOptionArg * | Arg (bool &val) |
| static class UOptionArg * | Arg (int &val) |
| static class UOptionArg * | Arg (float &val) |
| static class UOptionArg * | Arg (UStr &val) |
| static class UOptionArg * | Arg (char *&val) |
| static class UOptionArg * | Arg (const char *&val) |
| static void | parseOptions (int &argc, char **argv, UOption *options) |
Public Attributes | |
| const char * | begname |
| const char * | endname |
| UOptionArg * | arg |
example:
Source code for parsing these options:
char* input_file = null; int value = 1; bool reco_mode = false;
UOption options[] = {
{"in","put", UOption::Arg(input_file)}, // "in" is mandatory, "put" is optionnal
{"value","", UOption::Arg(value)}, // "value" is mandatory, no optionnal part
{"reco","", UOption::Arg(reco_mode)},
{null} // must be NULL terminated !!
};
// changes the values of variables 'input_file', 'value' and 'reco_mode' // if the corresponding options are specified in the command line
UConf conf(argc, argv, options); UAppli appli(conf); ...
1.4.7