SafeConfigNode Class Reference

#include <SafeConfigNode.h>

Inheritance diagram for SafeConfigNode:

Inheritance graph
[legend]
Collaboration diagram for SafeConfigNode:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 SafeConfigNode (const boost::shared_ptr< ConfigNode > &node)
 SafeConfigNode (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


Detailed Description

This class acts as filter between a real config node and its user: key/value strings which normally wouldn't be valid are escaped before passing them into the underlying node. When reading, they are unescaped again.

Unsafe characters are replaced by ! followed by two characters giving the character value in hex notation.

Definition at line 41 of file SafeConfigNode.h.


Constructor & Destructor Documentation

SafeConfigNode::SafeConfigNode ( const boost::shared_ptr< ConfigNode > &  node  ) 

read-write access to underlying node

Definition at line 25 of file SafeConfigNode.cpp.

SafeConfigNode::SafeConfigNode ( const boost::shared_ptr< const ConfigNode > &  node  ) 

read-only access to underlying node

Definition at line 31 of file SafeConfigNode.cpp.


Member Function Documentation

virtual bool SafeConfigNode::exists (  )  const [inline, virtual]

Node exists in backend storage.

Implements ConfigNode.

Definition at line 60 of file SafeConfigNode.h.

void SafeConfigNode::flush (  )  [virtual]

save all changes persistently

Implements ConfigNode.

Definition at line 70 of file SafeConfigNode.cpp.

References getName(), and EvolutionSyncClient::throwError().

virtual string SafeConfigNode::getName (  )  const [inline, virtual]

a name for the node that the user can understand

Implements ConfigNode.

Definition at line 49 of file SafeConfigNode.h.

Referenced by flush().

void SafeConfigNode::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.

Return values:
props to be filled with key/value pairs; guaranteed to be empty before the call

Implements ConfigNode.

Definition at line 52 of file SafeConfigNode.cpp.

string SafeConfigNode::readProperty ( const string &  property  )  const [virtual]

Returns the value of the given property

Parameters:
property - the property name
Returns:
value of the property or empty string if not set

Implements ConfigNode.

Definition at line 36 of file SafeConfigNode.cpp.

void SafeConfigNode::removeProperty ( const string &  property  )  [virtual]

Remove a certain property.

Parameters:
property the name of the property which is to be removed

Implements ConfigNode.

Definition at line 65 of file SafeConfigNode.cpp.

void SafeConfigNode::setProperty ( const string &  property,
const string &  value,
const string &  comment = "",
const string *  defValue = NULL 
) [virtual]

Sets a property value.

Parameters:
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 41 of file SafeConfigNode.cpp.


The documentation for this class was generated from the following files:

Generated on Sat Oct 18 17:17:05 2008 for SyncEvolution and Funambol by  doxygen 1.5.7.1