ubit
Static Public Member Functions | Public Attributes | List of all members
ubit::UOption Class Reference

specification and retreiving of non standard options on the command line. More...

#include <uconf.hpp>

Static Public Member Functions

static class UOptionArgArg (bool &val)
 
static class UOptionArgArg (int &val)
 
static class UOptionArgArg (float &val)
 
static class UOptionArgArg (UStr &val)
 
static class UOptionArgArg (char *&val)
 
static class UOptionArgArg (const char *&val)
 
static void parseOptions (int &argc, char **argv, UOption *options)
 

Public Attributes

const char * begname
 
const char * endname
 
class UOptionArgarg
 

Detailed Description

specification and retreiving of non standard options on the command line.

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);
  ...

The documentation for this class was generated from the following files: