FACT++  1.0
Configuration::Configuration ( const std::string &  prgname = "")

Definition at line 461 of file Configuration.cc.

References fName, fOptionsCommandline, fOptionsConfigfile, and kVisible.

Referenced by PrintUsage().

461  : fName(UnLibToolize(prgname)),
462 fNameMapper(bind1st(mem_fun(&Configuration::DefaultMapper), this)),
464 {
465  po::options_description generic("Generic options");
466  generic.add_options()
467  ("version,V", "Print version information.")
468  ("help", "Print available commandline options.")
469  ("help-environment", "Print available environment variables.")
470  ("help-database", "Print available options retreived from the database.")
471  ("help-config", "Print available configuration file options.")
472  ("print-all", "Print all options as parsed from all the different sources.")
473  ("print", "Print options as parsed from the commandline.")
474  ("print-default", "Print options as parsed from default configuration file.")
475  ("print-database", "Print options as retrieved from the database.")
476  ("print-config", "Print options as parsed from the high priority configuration file.")
477  ("print-environment", "Print options as parsed from the environment.")
478  ("print-unknown", "Print unrecognized options.")
479  ("print-options", "Print options as passed to program.")
480  ("print-wildcards", "Print all options registered with wildcards.")
481  ("dont-check", "Do not check validity of options from files and database.")
482  ("dont-check-files", "Do not check validity of options from files.")
483  ("dont-check-database", "Do not check validity of options from database.")
484  ;
485 
486  po::options_description def_config;
487  def_config.add_options()
488  ("default", var<string>(fName+string(".rc")), "Default configuration file.")
489  ;
490 
491  po::options_description config("Configuration options");
492  config.add_options()
493  ("config,C", var<string>(), "Configuration file overwriting options retrieved from the database.")
494  ("database", var<string>(), "Database link as in\n\t[user[:password]@]server.com[:port]/database\nOverwrites options from the default configuration file.")
495  ("no-database", "Suppress any access to the database even if a database URL was set.")
496  ;
497 
498  fOptionsCommandline[kVisible].add(generic);
499  fOptionsCommandline[kVisible].add(config);
500  fOptionsCommandline[kVisible].add(def_config);
501  fOptionsConfigfile[kVisible].add(config);
502 }
std::function< std::string(std::string)> fNameMapper
Pointer to the mapper function for environment variables.
Definition: Configuration.h:50
Index for options visible in PrintParsed.
Definition: Configuration.h:16
po::options_description fOptionsCommandline[2]
Definition: Configuration.h:23
const std::string fName
Definition: Configuration.h:19
po::options_description fOptionsConfigfile[2]
Description of the command-line options.
Definition: Configuration.h:24
std::function< void()> fPrintUsage
Definition: Configuration.h:51
std::string DefaultMapper(const std::string env)
Variables as compiled by the Parse-function, which will be passed to the program. ...
Definition: Configuration.h:44
std::string UnLibToolize(const std::string &src) const
virtual void PrintUsage() const
Definition: Configuration.h:74

+ Here is the caller graph for this function: