KeyValueStore Class Reference
[Client]

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

#include <KeyValueStore.h>

Inheritance diagram for KeyValueStore:
[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 int removeAllProperties ()=0
 Remove all the properties in the value store.
virtual EnumerationgetProperties ()=0
 Get all the properties that are currently defined.
virtual int close ()=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 int KeyValueStore::close (  )  [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 MemoryKeyValueStore, PropertyFile, SQLiteKeyValueStore, and BlockingSQLiteKeyValueStore.

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


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

Generated on Tue Apr 6 13:00:42 2010 for Funambol Outlook Plug-in Library by  doxygen 1.5.7.1