#include <ConfigNode.h>
Public Member Functions | |
virtual | ~ConfigNode () |
virtual string | getName () const =0 |
virtual void | flush ()=0 |
virtual string | readProperty (const string &property) const =0 |
virtual void | setProperty (const string &property, const string &value, const string &comment=string(""), const string *defValue=NULL)=0 |
virtual void | readProperties (map< string, string > &props) const =0 |
virtual void | removeProperty (const string &property)=0 |
virtual bool | exists () const =0 |
Definition at line 33 of file ConfigNode.h.
virtual ConfigNode::~ConfigNode | ( | ) | [inline, virtual] |
free resources without saving
Definition at line 36 of file ConfigNode.h.
virtual bool ConfigNode::exists | ( | ) | const [pure virtual] |
Node exists in backend storage.
Implemented in FileConfigNode, FilterConfigNode, PrefixConfigNode, and SafeConfigNode.
virtual void ConfigNode::flush | ( | ) | [pure virtual] |
save all changes persistently
Implemented in FileConfigNode, FilterConfigNode, PrefixConfigNode, SafeConfigNode, and VolatileConfigNode.
virtual string ConfigNode::getName | ( | ) | const [pure virtual] |
a name for the node that the user can understand
Implemented in FileConfigNode, FilterConfigNode, PrefixConfigNode, SafeConfigNode, and VolatileConfigNode.
Referenced by ConfigProperty::throwValueError().
virtual void ConfigNode::readProperties | ( | map< string, string > & | props | ) | const [pure virtual] |
Extract all list of all currently defined properties and their values. Does not include values which were initialized with their defaults, if the implementation remembers that.
props | to be filled with key/value pairs; guaranteed to be empty before the call |
Implemented in FileConfigNode, FilterConfigNode, PrefixConfigNode, and SafeConfigNode.
virtual string ConfigNode::readProperty | ( | const string & | property | ) | const [pure virtual] |
Returns the value of the given property
property | - the property name |
Implemented in FileConfigNode, FilterConfigNode, PrefixConfigNode, and SafeConfigNode.
Referenced by TypedConfigProperty< T >::getProperty(), and ConfigProperty::getProperty().
virtual void ConfigNode::removeProperty | ( | const string & | property | ) | [pure virtual] |
Remove a certain property.
property | the name of the property which is to be removed |
Implemented in FileConfigNode, FilterConfigNode, PrefixConfigNode, and SafeConfigNode.
virtual void ConfigNode::setProperty | ( | const string & | property, | |
const string & | value, | |||
const string & | comment = string("") , |
|||
const string * | defValue = NULL | |||
) | [pure virtual] |
Sets a property value.
property | the property name | |
value | the property value (zero terminated string) | |
comment | a comment explaining what the property is about, with separating lines; might be used by the backend when adding a new property | |
defValue | If a defValue is provided and the value matches the default, then the node is asked to remember that the value hasn't really been changed. An implementation can decide to not support this. |
Implemented in FileConfigNode, FilterConfigNode, PrefixConfigNode, and SafeConfigNode.
Referenced by ConfigProperty::setDefaultProperty(), TypedConfigProperty< T >::setProperty(), and ConfigProperty::setProperty().