utilmm::config_set Class Reference

#include <utilmm/configfile/configset.hh>

Inheritance diagram for utilmm::config_set:

utilmm::config_file

List of all members.

Public Types

typedef std::list
< const config_set * > 
subsets

Public Member Functions

 config_set (config_set *parent=0)
 ~config_set ()
bool empty () const
bool exists (const std::string &attribute) const
const config_setparent () const
config_setparent ()
std::list< const
config_set * > 
children (const std::string &name) const
config_set const & child (std::string const &name) 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
void set (std::string const &name, std::string const &value)
void set (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, std::list< std::string > const &value)
void insert (std::string const &name, config_set const *value)
void erase (std::string const &name)
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

Protected Types

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

Protected Member Functions

void clear ()

Protected Attributes

config_setm_parent
ValueMap m_values
ChildMap m_children

Friends

class ConfigFile


Detailed Description

A scope in configuration files

Member Typedef Documentation

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

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

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


Constructor & Destructor Documentation

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

utilmm::config_set::~config_set (  ) 


Member Function Documentation

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

Clears this set

bool utilmm::config_set::empty (  )  const

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

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

Tests for the existence of an attribute

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* utilmm::config_set::parent (  ) 

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

Get the list of children named name

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

Get the first child named name or an empty set

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]

Get a list of values from this config_set

Define accessors for lists

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]

Get a value from this config_set. If there is more than one value for this key, then the first one is returned

Define accessor for scalars

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

Set the value for this key

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

Sets multiple values for this key

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

Insert a value in this config_set

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

Inserts multiple values in this config_set

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

Add a child to this config_set

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

Remove the given option

template<>
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]

Define the basic access function: list of strings. Everything is derived from this one and from the convert<> functions


Friends And Related Function Documentation

friend class ConfigFile [friend]


Member Data Documentation

config_set* utilmm::config_set::m_parent [protected]

ValueMap utilmm::config_set::m_values [protected]

ChildMap utilmm::config_set::m_children [protected]


The documentation for this class was generated from the following file:
Generated on Tue Feb 19 10:51:01 2008 for Util-- by doxygen 1.5.3
SourceForge.net Project Page