LeechCraft  0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
IPersistentStorage Class Referenceabstract

Provides access to a storage in an IPersistentStoragePlugin. More...

#include "ipersistentstorageplugin.h"

Public Member Functions

virtual ~IPersistentStorage ()
 Closes this storage handle. More...
 
virtual bool HasKey (const QByteArray &key)=0
 Checks if the given key exists in the storage. More...
 
virtual QVariant Get (const QByteArray &key)=0
 Returns the value associated with the given key. More...
 
virtual void Set (const QByteArray &key, const QVariant &value)=0
 Stores the value under the given key. More...
 

Detailed Description

Provides access to a storage in an IPersistentStoragePlugin.

The storage is a key-value database. The keys can be queried via the Get() method and set or updated via the Set() method.

Definition at line 21 of file ipersistentstorageplugin.h.

Constructor & Destructor Documentation

◆ ~IPersistentStorage()

virtual IPersistentStorage::~IPersistentStorage ( )
inlinevirtual

Closes this storage handle.

Definition at line 26 of file ipersistentstorageplugin.h.

Member Function Documentation

◆ Get()

virtual QVariant IPersistentStorage::Get ( const QByteArray &  key)
pure virtual

Returns the value associated with the given key.

Note
This function may return a null QVariant either if the key was not set, or if it was set to a null QVariant before. These two cases are effectively indistinguishable.
Parameters
[in]keyThe key for which the value should be returned.
Returns
The value for this key or a null QVariant if no value is set.
See also
HasKey()
Set()

◆ HasKey()

virtual bool IPersistentStorage::HasKey ( const QByteArray &  key)
pure virtual

Checks if the given key exists in the storage.

Parameters
[in]keyThe key to check for.
Returns
Whether the given key exists in the storage.
See also
Get()
Set()

◆ Set()

virtual void IPersistentStorage::Set ( const QByteArray &  key,
const QVariant &  value 
)
pure virtual

Stores the value under the given key.

Parameters
[in]keyThe key for which the value should be returned.
[in]valueThe value to associate with the key.
See also
HasKey()
Get()

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