#include <homefiledatastore.h>
List of all members.
Public Member Functions |
| HomeFileDataStore (const QString &filePath) |
virtual | ~HomeFileDataStore () |
virtual bool | createValue (const QString &key, const QVariant &value) |
| REIMPLEMENTATION
|
virtual bool | setValue (const QString &key, const QVariant &value) |
virtual QVariant | value (const QString &key) const |
virtual QStringList | allKeys () const |
virtual void | remove (const QString &key) |
virtual void | clear () |
virtual bool | contains (const QString &key) const |
bool | isReadable () const |
|
|
bool | isWritable () const |
bool | createValues (const QHash< QString, QVariant > &values) |
Protected Attributes |
HomeFileDataStorePrivate *const | d_ptr |
Detailed Description
Concrete implementation of MDataStore
interface. This class stores the data to the filesystem. The file name is given as a constructor parameter.
Constructor & Destructor Documentation
HomeFileDataStore::HomeFileDataStore |
( |
const QString & |
filePath |
) |
[explicit] |
Constructor.
- Parameters:
-
| filePath | Absolute path to the file that the settings will be written to and read from. |
HomeFileDataStore::~HomeFileDataStore |
( |
|
) |
[virtual] |
Member Function Documentation
QStringList HomeFileDataStore::allKeys |
( |
|
) |
const [virtual] |
If isReadable
returns false
, this method returns an empty list.
void HomeFileDataStore::clear |
( |
|
) |
[virtual] |
If isWritable
returns false
, this method does nothing.
bool HomeFileDataStore::contains |
( |
const QString & |
key |
) |
const [virtual] |
If isReadable
returns false
, this method returns false
.
bool HomeFileDataStore::createValue |
( |
const QString & |
key, |
|
|
const QVariant & |
value | |
|
) |
| | [virtual] |
REIMPLEMENTATION
If isWritable
returns false
, this method returns false
.
bool HomeFileDataStore::createValues |
( |
const QHash< QString, QVariant > & |
values |
) |
|
Creates values to data store from given hash of key value pairs. With this method QSetting sync (file write) is done only once, which provides better performance then createValue() when storing multiple values.
- Parameters:
-
| newValues | the hash of key-value pairs that are updated to data store. |
- Returns:
true
if the data store can be written
bool HomeFileDataStore::isReadable |
( |
|
) |
const |
Queries if this data store is readable. If this method returns true
you can use the reading methods of this class (value
, allKeys
, contains
). If this method returns false
, the reading methods don't provide the real data.
- See also:
- value, allKeys, contains
- Returns:
true
if the data store can be read.
bool HomeFileDataStore::isWritable |
( |
|
) |
const |
Queries if this data store is writable. If this method returns true
you can use the writing methods of this class (setValue
, remove
, clear
). If this method returns false
, the writing methods don't modify the data store.
- See also:
- setValue, remove, clear
- Returns:
true
if the data store can be written.
void HomeFileDataStore::remove |
( |
const QString & |
key |
) |
[virtual] |
If isWritable
returns false
, this method does nothing.
bool HomeFileDataStore::setValue |
( |
const QString & |
key, |
|
|
const QVariant & |
value | |
|
) |
| | [virtual] |
If isWritable
returns false
, this method returns false
.
QVariant HomeFileDataStore::value |
( |
const QString & |
key |
) |
const [virtual] |
If isReadable
returns false
, this method returns an empty QVariant.
Member Data Documentation
The documentation for this class was generated from the following files: