utilmm::config_set Class Reference

#include <configset.hh>

Inheritance diagram for utilmm::config_set:
Inheritance graph
[legend]

List of all members.

Public Types

typedef std::list< const
config_set * > 
subsets
typedef std::list< const
config_set * > 
subsets

Public Member Functions

config_set const & child (std::string const &name) const
config_set const & child (std::string const &name) const
std::list< const config_set * > children (const std::string &name) const
std::list< const config_set * > children (const std::string &name) const
 config_set (config_set *parent=0)
 config_set (config_set *parent=0)
bool empty () const
bool empty () const
void erase (std::string const &name)
void erase (std::string const &name)
bool exists (const std::string &attribute) const
bool exists (const std::string &attribute) const
template<>
config_set::stringlist get (std::string const &name, config_set::stringlist const &defval, boost::enable_if< details::is_list< config_set::stringlist > >::type *enabler) const
template<typename T >
get (std::string const &name, T const &defval=T(), typename boost::disable_if< details::is_list< T > >::type *enabler=0) const
template<typename T >
get (std::string const &name, T const &defval=T(), typename boost::enable_if< details::is_list< T > >::type *enabler=0) const
template<typename T >
get (std::string const &name, T const &defval=T(), typename boost::disable_if< details::is_list< T > >::type *enabler=0) const
template<typename T >
get (std::string const &name, T const &defval=T(), typename boost::enable_if< details::is_list< T > >::type *enabler=0) const
void insert (std::string const &name, config_set const *value)
void insert (std::string const &name, std::list< std::string > const &value)
void insert (std::string const &name, std::string const &value)
void insert (std::string const &name, config_set const *value)
void insert (std::string const &name, std::list< std::string > const &value)
void insert (std::string const &name, std::string const &value)
config_setparent ()
const config_setparent () const
config_setparent ()
const config_setparent () const
void set (std::string const &name, std::list< std::string > const &value)
void set (std::string const &name, std::string const &value)
void set (std::string const &name, std::list< std::string > const &value)
void set (std::string const &name, std::string const &value)
 ~config_set ()
 ~config_set ()

Protected Types

typedef std::multimap
< std::string, const
config_set * > 
ChildMap
typedef std::multimap
< std::string, const
config_set * > 
ChildMap
typedef std::multimap
< std::string, std::string > 
ValueMap
typedef std::multimap
< std::string, std::string > 
ValueMap

Protected Member Functions

void clear ()
void clear ()

Protected Attributes

ChildMap m_children
config_setm_parent
ValueMap m_values

Private Types

typedef std::list< std::string > stringlist
typedef std::list< std::string > stringlist

Static Private Member Functions

template<typename T >
static T convert (std::string const &value)
template<typename T >
static T convert (std::string const &value)

Friends

class ConfigFile

Detailed Description

A scope in configuration files

Definition at line 24 of file install/include/utilmm/configfile/configset.hh.


Member Typedef Documentation

typedef std::multimap<std::string, const config_set*> utilmm::config_set::ChildMap [protected]

Definition at line 38 of file utilmm/configfile/configset.hh.

typedef std::multimap<std::string, const config_set*> utilmm::config_set::ChildMap [protected]
typedef std::list<std::string> utilmm::config_set::stringlist [private]

Definition at line 30 of file utilmm/configfile/configset.hh.

typedef std::list<std::string> utilmm::config_set::stringlist [private]
typedef std::list<const config_set*> utilmm::config_set::subsets

Definition at line 49 of file utilmm/configfile/configset.hh.

typedef std::list<const config_set*> utilmm::config_set::subsets
typedef std::multimap<std::string, std::string> utilmm::config_set::ValueMap [protected]

Definition at line 36 of file utilmm/configfile/configset.hh.

typedef std::multimap<std::string, std::string> utilmm::config_set::ValueMap [protected]

Constructor & Destructor Documentation

config_set::config_set ( config_set parent = 0  )  [explicit]

Definition at line 7 of file configset.cc.

config_set::~config_set (  ) 

Definition at line 10 of file configset.cc.

utilmm::config_set::config_set ( config_set parent = 0  )  [explicit]
utilmm::config_set::~config_set (  ) 

Member Function Documentation

config_set const& utilmm::config_set::child ( std::string const &  name  )  const

Get the first child named name or an empty set

config_set const & config_set::child ( std::string const &  name  )  const

Get the first child named name or an empty set

Definition at line 48 of file configset.cc.

std::list<const config_set*> utilmm::config_set::children ( const std::string &  name  )  const

Get the list of children named name

list< const config_set * > config_set::children ( const std::string &  name  )  const

Get the list of children named name

Definition at line 30 of file configset.cc.

void utilmm::config_set::clear (  )  [protected]

Clears this set

void config_set::clear (  )  [protected]

Clears this set

Definition at line 17 of file configset.cc.

template<typename T >
static T utilmm::config_set::convert ( std::string const &  value  )  [inline, static, private]
template<typename T >
T utilmm::config_set::convert ( std::string const &  value  )  [inline, static, private]
bool utilmm::config_set::empty (  )  const

Checks if this set is empty (no child, no attributes)

bool config_set::empty (  )  const

Checks if this set is empty (no child, no attributes)

Definition at line 15 of file configset.cc.

void utilmm::config_set::erase ( std::string const &  name  ) 

Remove the given option

void config_set::erase ( std::string const &  name  ) 

Remove the given option

Definition at line 84 of file configset.cc.

bool utilmm::config_set::exists ( const std::string &  attribute  )  const

Tests for the existence of an attribute

bool config_set::exists ( const std::string &  attribute  )  const

Tests for the existence of an attribute

Definition at line 57 of file configset.cc.

config_set::stringlist utilmm::config_set::get ( std::string const &  name,
config_set::stringlist const &  defval,
boost::enable_if< details::is_list< config_set::stringlist > >::type *  enabler 
) const [inline]

Definition at line 100 of file configset.cc.

template<typename T >
T utilmm::config_set::get ( std::string const &  name,
T const &  defval = T(),
typename boost::disable_if< details::is_list< T > >::type *  enabler = 0 
) const [inline]

In a config_set object, all values are stored as lists of strings. This method is a convenience method when only one value is stored for a given key. It converts the stored value into the required type using the associated config_set::convert template specialization (if it exists).

If no value is associated with the key, returns defval

template<typename T >
T utilmm::config_set::get ( std::string const &  name,
T const &  defval = T(),
typename boost::enable_if< details::is_list< T > >::type *  enabler = 0 
) const [inline]

In a config_set object, all values are stored as lists of strings. This method converts the stored value into the required type using the associated config_set::convert template specialization (if it exists).

If no value is stored under the given key, returns defval

template<typename T >
T utilmm::config_set::get ( std::string const &  name,
T const &  defval = T(),
typename boost::disable_if< details::is_list< T > >::type *  enabler = 0 
) const [inline]

In a config_set object, all values are stored as lists of strings. This method is a convenience method when only one value is stored for a given key. It converts the stored value into the required type using the associated config_set::convert template specialization (if it exists).

If no value is associated with the key, returns defval

Definition at line 138 of file install/include/utilmm/configfile/configset.hh.

template<typename T >
T utilmm::config_set::get ( std::string const &  name,
T const &  defval = T(),
typename boost::enable_if< details::is_list< T > >::type *  enabler = 0 
) const [inline]

In a config_set object, all values are stored as lists of strings. This method converts the stored value into the required type using the associated config_set::convert template specialization (if it exists).

If no value is stored under the given key, returns defval

Definition at line 123 of file install/include/utilmm/configfile/configset.hh.

void utilmm::config_set::insert ( std::string const &  name,
config_set const *  value 
)

Add a child to this config_set

void utilmm::config_set::insert ( std::string const &  name,
std::list< std::string > const &  value 
)

Appends the given values to the valus already associated with name

void utilmm::config_set::insert ( std::string const &  name,
std::string const &  value 
)

Appends the given value to the values already associated with name

void config_set::insert ( std::string const &  name,
config_set const *  value 
)

Add a child to this config_set

Definition at line 72 of file configset.cc.

void config_set::insert ( std::string const &  name,
std::list< std::string > const &  value 
)

Appends the given values to the valus already associated with name

Definition at line 66 of file configset.cc.

void config_set::insert ( std::string const &  name,
std::string const &  value 
)

Appends the given value to the values already associated with name

Definition at line 64 of file configset.cc.

config_set* utilmm::config_set::parent (  ) 
const config_set* utilmm::config_set::parent (  )  const

The parent config_set object

Returns:
the config_set object for our parent scope, or 0 if this scope is top-level
config_set * config_set::parent (  ) 

Definition at line 29 of file configset.cc.

const config_set * config_set::parent (  )  const

The parent config_set object

Returns:
the config_set object for our parent scope, or 0 if this scope is top-level

Definition at line 28 of file configset.cc.

void utilmm::config_set::set ( std::string const &  name,
std::list< std::string > const &  value 
)

Sets multiple values for this key. If some value was already associated with name, the new value replaces it. See insert to append new values to already existing ones.

void utilmm::config_set::set ( std::string const &  name,
std::string const &  value 
)

Replaces any value associated with name with the value provided. See insert to append new values to already existing ones

void config_set::set ( std::string const &  name,
std::list< std::string > const &  value 
)

Sets multiple values for this key. If some value was already associated with name, the new value replaces it. See insert to append new values to already existing ones.

Definition at line 79 of file configset.cc.

void config_set::set ( std::string const &  name,
std::string const &  value 
)

Replaces any value associated with name with the value provided. See insert to append new values to already existing ones

Definition at line 74 of file configset.cc.


Friends And Related Function Documentation

ConfigFile [friend]

Member Data Documentation


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


utilmm
Author(s): Sylvain Joyeux/sylvain.joyeux@m4x.org
autogenerated on Fri Jan 11 10:07:42 2013