KeyValueStore Class Reference
[Client]

#include <KeyValueStore.h>

Inheritance diagram for KeyValueStore:

Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ~KeyValueStore ()
virtual StringBuffer readPropertyValue (const char *prop) const =0
virtual int setPropertyValue (const char *prop, const char *value)=0
virtual int removeProperty (const char *prop)=0
virtual EnumerationgetProperties () const =0
virtual int save ()=0


Detailed Description

This is the interface for the handling of key/value pairs. Some implementations might store them in some kind of background storage, others might only save them transiently in memory.

This class defines the common methods that have to be specialized by implementation on filesystem, registry, db...

Definition at line 57 of file KeyValueStore.h.


Constructor & Destructor Documentation

virtual KeyValueStore::~KeyValueStore (  )  [inline, virtual]

Virtual destructor

Definition at line 64 of file KeyValueStore.h.


Member Function Documentation

virtual Enumeration& KeyValueStore::getProperties (  )  const [pure virtual]

Get all the properties that are currently defined.

Implemented in ArrayListKeyValueStore.

virtual StringBuffer KeyValueStore::readPropertyValue ( const char *  prop  )  const [pure virtual]

Returns the value of the given property

Parameters:
prop - the property name
Returns:
A NULL StringBuffer in the returned implies that the property was not set. Otherwise the value it was set to is returned (which can be "", the empty string).

Implemented in ArrayListKeyValueStore.

virtual int KeyValueStore::removeProperty ( const char *  prop  )  [pure virtual]

Remove a certain property

Parameters:
prop the name of the property which is to be removed
Returns:
int 0 on success, an error code otherwise

Implemented in ArrayListKeyValueStore.

virtual int KeyValueStore::save (  )  [pure virtual]

Ensure that all properties are stored persistently. If setting a property led to an error earlier, this call will indicate the failure.

Returns:
0 - success, failure otherwise

Implemented in ArrayListKeyValueStore, and PropertyFile.

virtual int KeyValueStore::setPropertyValue ( const char *  prop,
const char *  value 
) [pure virtual]

Sets a property value.

The value might be cached inside the implementation of this interface. To ensure that it is stored persistently and to do error checking, call save().

Parameters:
prop - the property name
value - the property value (zero terminated string)
Returns:
int 0 on success, an error code otherwise

Implemented in ArrayListKeyValueStore.


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

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