FilterConfigNode Class Reference

#include <FilterConfigNode.h>

Inheritance diagram for FilterConfigNode:

Inheritance graph
[legend]
Collaboration diagram for FilterConfigNode:

Collaboration graph
[legend]

List of all members.

Classes

class  ConfigFilter

Public Member Functions

 FilterConfigNode (const boost::shared_ptr< ConfigNode > &node, const ConfigFilter &filter=ConfigFilter())
 FilterConfigNode (const boost::shared_ptr< const ConfigNode > &node, const ConfigFilter &filter=ConfigFilter())
virtual string getName () const
void addFilter (const string &property, const string &value)
void setFilter (const ConfigFilter &filter)
const ConfigFiltergetFilter () 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: reads which match properties which are set in the filter will return the value set in the filter. Writes will go to the underlying node and future reads will return the written value.

The purpose of this class is temporarily overriding saved values during one run without having to modify the saved values.

Definition at line 45 of file FilterConfigNode.h.


Constructor & Destructor Documentation

FilterConfigNode::FilterConfigNode ( const boost::shared_ptr< ConfigNode > &  node,
const ConfigFilter filter = ConfigFilter() 
)

read-write access to underlying node

Definition at line 25 of file FilterConfigNode.cpp.

FilterConfigNode::FilterConfigNode ( const boost::shared_ptr< const ConfigNode > &  node,
const ConfigFilter filter = ConfigFilter() 
)

read-only access to underlying node

Definition at line 33 of file FilterConfigNode.cpp.


Member Function Documentation

void FilterConfigNode::addFilter ( const string &  property,
const string &  value 
)

add another entry to the list of filter properties

Definition at line 40 of file FilterConfigNode.cpp.

Referenced by TypedConfigProperty< T >::setProperty(), and ConfigProperty::setProperty().

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

Node exists in backend storage.

Implements ConfigNode.

Definition at line 81 of file FilterConfigNode.h.

void FilterConfigNode::flush (  )  [virtual]

save all changes persistently

Implements ConfigNode.

Reimplemented in VolatileConfigNode.

Definition at line 102 of file FilterConfigNode.cpp.

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

const ConfigFilter& FilterConfigNode::getFilter (  )  const [inline]

Definition at line 70 of file FilterConfigNode.h.

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

a name for the node that the user can understand

Implements ConfigNode.

Reimplemented in VolatileConfigNode.

Definition at line 62 of file FilterConfigNode.h.

Referenced by flush(), removeProperty(), and setProperty().

void FilterConfigNode::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 79 of file FilterConfigNode.cpp.

string FilterConfigNode::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 51 of file FilterConfigNode.cpp.

void FilterConfigNode::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 88 of file FilterConfigNode.cpp.

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

void FilterConfigNode::setFilter ( const ConfigFilter filter  ) 

replace current filter list with new one

Definition at line 46 of file FilterConfigNode.cpp.

void FilterConfigNode::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 62 of file FilterConfigNode.cpp.

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

Referenced by TypedConfigProperty< T >::setProperty(), and ConfigProperty::setProperty().


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

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