GCS  0.2.3
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes
gu::Config Class Reference

Data Structures

class  Parameter
 

Public Types

typedef std::map< std::string,
Parameter
param_map_t
 
typedef param_map_t::const_iterator const_iterator
 

Public Member Functions

bool has (const std::string &key) const
 
bool is_set (const std::string &key) const
 
void add (const std::string &key)
 
void add (const std::string &key, const std::string &value)
 
void set (const std::string &key, const std::string &value)
 
void set (const std::string &key, const char *value)
 
void parse (const std::string &params_string)
 
template<typename T >
void set (const std::string &key, T val)
 
const std::string & get (const std::string &key) const
 
const std::string & get (const std::string &key, const std::string &def) const
 
template<typename T >
get (const std::string &key) const
 
template<typename T >
get (const std::string &key, const T &def) const
 
void print (std::ostream &os, bool include_not_set=false) const
 
const_iterator begin () const
 
const_iterator end () const
 
template<>
double from_config (const std::string &value)
 
template<>
bool from_config (const std::string &value)
 
template<>
void * from_config (const std::string &value)
 
template<>
void set (const std::string &key, const void *value)
 
template<>
void set (const std::string &key, double val)
 
template<>
void set (const std::string &key, bool val)
 

Static Public Member Functions

static void parse (std::vector< std::pair< std::string, std::string > > &params_vector, const std::string &params_string)
 
template<typename T >
static T from_config (const std::string &value)
 

Static Public Attributes

static const char PARAM_SEP
 
static const char KEY_VALUE_SEP
 
static const char ESCAPE
 

Member Function Documentation

template<typename T >
static T gu::Config::from_config ( const std::string &  value)
inlinestatic

Convert string configuration values to other types. General template for integers, specialized templates follow below.

template<>
double gu::Config::from_config ( const std::string &  value)
inline

Specialized templates for "funny" types

const std::string& gu::Config::get ( const std::string &  key) const
inline
Exceptions
NotSet,NotFound
template<typename T >
T gu::Config::get ( const std::string &  key) const
inline
Exceptions
NotFound

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