#include <PrefixConfigNode.h>
Public Member Functions | |
PrefixConfigNode (const string prefix, const boost::shared_ptr< ConfigNode > &node) | |
PrefixConfigNode (const string prefix, const boost::shared_ptr< const ConfigNode > &node) | |
virtual string | getName () const |
virtual void | flush () |
virtual string | readProperty (const string &property) const |
virtual void | setProperty (const string &property, const string &value, const string &comment="", const string *defValue=NULL) |
virtual void | readProperties (map< string, string > &props) const |
virtual void | removeProperty (const string &property) |
virtual bool | exists () const |
The purpose is to have multiple users accessing the same underlying node without running into namespace conflicts.
Definition at line 41 of file PrefixConfigNode.h.
PrefixConfigNode::PrefixConfigNode | ( | const string | prefix, | |
const boost::shared_ptr< ConfigNode > & | node | |||
) |
read-write access to underlying node
Definition at line 26 of file PrefixConfigNode.cpp.
PrefixConfigNode::PrefixConfigNode | ( | const string | prefix, | |
const boost::shared_ptr< const ConfigNode > & | node | |||
) |
read-only access to underlying node
Definition at line 34 of file PrefixConfigNode.cpp.
virtual bool PrefixConfigNode::exists | ( | ) | const [inline, virtual] |
Node exists in backend storage.
Implements ConfigNode.
Definition at line 62 of file PrefixConfigNode.h.
void PrefixConfigNode::flush | ( | ) | [virtual] |
save all changes persistently
Implements ConfigNode.
Definition at line 77 of file PrefixConfigNode.cpp.
References getName(), and EvolutionSyncClient::throwError().
virtual string PrefixConfigNode::getName | ( | ) | const [inline, virtual] |
a name for the node that the user can understand
Implements ConfigNode.
Definition at line 51 of file PrefixConfigNode.h.
Referenced by flush().
void PrefixConfigNode::readProperties | ( | map< string, string > & | props | ) | const [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 |
Implements ConfigNode.
Definition at line 57 of file PrefixConfigNode.cpp.
string PrefixConfigNode::readProperty | ( | const string & | property | ) | const [virtual] |
Returns the value of the given property
property | - the property name |
Implements ConfigNode.
Definition at line 41 of file PrefixConfigNode.cpp.
void PrefixConfigNode::removeProperty | ( | const string & | property | ) | [virtual] |
Remove a certain property.
property | the name of the property which is to be removed |
Implements ConfigNode.
Definition at line 72 of file PrefixConfigNode.cpp.
void PrefixConfigNode::setProperty | ( | const string & | property, | |
const string & | value, | |||
const string & | comment = "" , |
|||
const string * | defValue = NULL | |||
) | [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. |
Implements ConfigNode.
Definition at line 46 of file PrefixConfigNode.cpp.