All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Valuable::ConfigElement Class Reference

Configuration block in ConfigDocument. More...

#include <Valuable/ConfigElement.hpp>

Public Member Functions

void addElement (const ConfigElement &e)
 Adds a sub-element to the element.
 
void addValue (const ConfigValue &v)
 Adds a value to the element.
 
const ConfigElementchild (size_t n) const
 Returns the ith sub-element. More...
 
ConfigElementchild (size_t n)
 Returns the ith sub-element. More...
 
size_t childCount () const
 Returns the number of sub-elements.
 
void clear ()
 Removes all values from the element.
 
const QString & elementName () const
 Returns the name of the element.
 
ConfigValuegetConfigValue (const QString &key)
 Gets the value with the given name. More...
 
ConfigValue getConfigValueSafe (const QString &key)
 Gets the value with the given name. More...
 
void setElementName (const QString &name)
 Sets the name of the element.
 
void setType (const QString &type)
 Sets the type of the element.
 
const ConfigValuevalue (size_t n) const
 Returns the ith value.
 
size_t valueCount () const
 Returns the number of values in the element.
 

Friends

class ConfigDocument
 

Detailed Description

Configuration block in ConfigDocument.

Member Function Documentation

const ConfigElement& Valuable::ConfigElement::child ( size_t  n) const
inline

Returns the ith sub-element.

Parameters
nIndex of child, starting from 0
Returns
Child config element
ConfigElement& Valuable::ConfigElement::child ( size_t  n)
inline

Returns the ith sub-element.

Parameters
nIndex of child, starting from 0
Returns
Child config element
ConfigValue* Valuable::ConfigElement::getConfigValue ( const QString &  key)

Gets the value with the given name.

Parameters
keyname of the value
Returns
pointer to the value or 0 if the value is not found
ConfigValue Valuable::ConfigElement::getConfigValueSafe ( const QString &  key)

Gets the value with the given name.

Parameters
keyname of the value
Returns
copy of the value or an empty value if the given key is not found