KeyValueStore Class Reference
[Sync Client]

This is the interface for the handling of key/value pairs. More...

#include <KeyValueStore.h>

Inheritance diagram for KeyValueStore:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual ~KeyValueStore ()
 Virtual destructor.
virtual StringBuffer readPropertyValue (const char *prop) const=0
 Returns the value of the given property.
virtual int setPropertyValue (const char *prop, const char *value)=0
 Sets a property value.
virtual int removeProperty (const char *prop)=0
 Remove a certain property.
virtual EnumerationgetProperties () const=0
 Get all the properties that are currently defined.
virtual int save ()=0
 Ensure that all properties are stored persistently.

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...


Member Function Documentation

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, and SQLKeyValueStore.

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, and SQLKeyValueStore.

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, and SQLKeyValueStore.

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, PropertyFile, and SQLKeyValueStore.


The documentation for this class was generated from the following file:
Generated on Fri Jul 25 15:04:20 2008 for Funambol C++ Client Library by  doxygen 1.5.1