'ODTONE - Open Dot Twenty One'

PrevUpHomeNext

Class config

odtone::mih::config

Synopsis

// In header: </home/carlos/Projectos/odtone/inc/odtone/mih/config.hpp>


class config {
public:
  // construct/copy/destruct
  config(po::options_description &);
  ~config();

  // public member functions
  bool help();
  bool parse(int, char *, const char *);
  template<typename T> T get(const char *) const;
  uint count(const char *);
};

Description

Configuration and command line options parser

This class provides parsing for command line options and configuration files for a set of predefined options description.

config public construct/copy/destruct

  1. config(po::options_description & desc);

    Construct a configuration and command line options parser.

    Parameters:

    desc

    A set of option descriptions.

  2. ~config();

    Destruct a configuration and command line options parser.

config public member functions

  1. bool help();

    Check if the help option was specified.

    Returns:

    True if the help option is present or false otherwise.

  2. bool parse(int argc, char * argv, const char * conf_file_option);

    Parse the command line arguments.

    Parameters:

    argc

    Number of arguments passed through the command line.

    argv

    Arguments passed through the command line.

    conf_file_option

    Name of configuration file.

  3. template<typename T> T get(const char * var) const;

    Get option variable value.

    Parameters:

    var

    The variable name.

  4. uint count(const char * var);

    Count the number of option variables.

    Parameters:

    var

    Number of variables.


PrevUpHomeNext