ConfigWrapper_t Struct Reference

#include <configwrapper.h>

Collaboration diagram for ConfigWrapper_t:

[legend]
List of all members.

Public Types

enum  TimeType_t { TT_SECONDS, TT_MILISECONDS }
 Defines time record type in config (stored in sec or msec). More...

Public Member Functions

 ConfigWrapper_t (const ConfigParser_t &config)
void getString (const std::string &section, const std::string &option, std::string &value) const
 Reads string value from config.
void getInt (const std::string &section, const std::string &option, unsigned int &value) const
 Reads unsigned int value from config.
void getInt (const std::string &section, const std::string &option, int &value) const
 Reads int value from config.
void getTime (const std::string &section, const std::string &option, time_t &value) const
 Reads time_t value from config.
void getFloat (const std::string &section, const std::string &option, float &value) const
 Reads float value from config.
void getBool (const std::string &section, const std::string &option, bool &value) const
 Reads bool value from config.
timeval getTimeval (const std::string &section, const std::string &option, unsigned int defaultValue, TimeType_t timeType) const
 Reads timeval value from config.

Public Attributes

const ConfigParser_tconfig

Member Enumeration Documentation

enum ConfigWrapper_t::TimeType_t

Defines time record type in config (stored in sec or msec).

Enumerator:
TT_SECONDS 
TT_MILISECONDS 


Constructor & Destructor Documentation

ConfigWrapper_t::ConfigWrapper_t ( const ConfigParser_t config  )  [inline]


Member Function Documentation

void ConfigWrapper_t::getString ( const std::string &  section,
const std::string &  option,
std::string &  value 
) const

Reads string value from config.

If option is not found, value is left untouched.

Parameters:
section section if config
option option in the given section
value read string value

void ConfigWrapper_t::getInt ( const std::string &  section,
const std::string &  option,
unsigned int &  value 
) const

Reads unsigned int value from config.

If option is not found, value is left untouched.

Parameters:
section section if config
option option in the given section
value read unsigned int value

void ConfigWrapper_t::getInt ( const std::string &  section,
const std::string &  option,
int &  value 
) const

Reads int value from config.

If option is not found, value is left untouched.

Parameters:
section section if config
option option in the given section
value read int value

void ConfigWrapper_t::getTime ( const std::string &  section,
const std::string &  option,
time_t &  value 
) const

Reads time_t value from config.

If option is not found, value is left untouched.

Parameters:
section section if config
option option in the given section
value read time_t value

void ConfigWrapper_t::getFloat ( const std::string &  section,
const std::string &  option,
float &  value 
) const

Reads float value from config.

If option is not found, value is left untouched.

Parameters:
section section if config
option option in the given section
value read float value

void ConfigWrapper_t::getBool ( const std::string &  section,
const std::string &  option,
bool &  value 
) const

Reads bool value from config.

If value is 'true' or 'yes' (in any case) value is set to true. If value is 'false' or 'no' (in any case) value is set to false. Otherwise value is left untouched and error message is given.

Parameters:
section section if config
option option in the given section
value read bool value

struct timeval ConfigWrapper_t::getTimeval ( const std::string &  section,
const std::string &  option,
unsigned int  defaultValue,
TimeType_t  timeType 
) const

Reads timeval value from config.

If option is not found, value is left untouched.

Parameters:
section section if config
option option in the given section
defaultValue dafault time value
timeType time record type (TT_SECONDS or TT_MILISECONDS)
Returns:
struct timeval - if not found creates timeval from defaultValue


Member Data Documentation

const ConfigParser_t& ConfigWrapper_t::config


The documentation for this struct was generated from the following file:
Generated on Wed May 7 13:41:38 2008 for Cfgparser (c) SEZNAM.CZ a.s. by  doxygen 1.5.1