Home · All Classes · Main Classes · Deprecated
Public Member Functions | Protected Attributes

MFileDataStore Class Reference

Inheritance diagram for MFileDataStore:
Inheritance graph
[legend]
Collaboration diagram for MFileDataStore:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 MFileDataStore (const QString &filePath)
virtual ~MFileDataStore ()
bool isReadable () const
bool isWritable () const

Protected Attributes

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

Definition at line 31 of file corelib/core/mfiledatastore.h.


Constructor & Destructor Documentation

MFileDataStore::MFileDataStore ( const QString filePath  )  [explicit]

Constructor.

Parameters:
filePath Absolute path to the file that the settings will be written to and read from.

Definition at line 147 of file mfiledatastore.cpp.

                                                      :
    d_ptr(new MFileDataStorePrivate(filePath))
{
    Q_D(MFileDataStore);
    takeSnapshot();
    addPathsToWatcher(filePath, d->watcher);
    connect(d->watcher.data(), SIGNAL(fileChanged(QString)),
            this, SLOT(fileChanged(QString)));
    connect(d->watcher.data(), SIGNAL(directoryChanged(QString)),
            this, SLOT(directoryChanged(QString)));
}

Here is the call graph for this function:

MFileDataStore::~MFileDataStore (  )  [virtual]

Destructor

Definition at line 159 of file mfiledatastore.cpp.

{
    delete d_ptr;
}


Member Function Documentation

bool MFileDataStore::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.

Definition at line 274 of file mfiledatastore.cpp.

{
    Q_D(const MFileDataStore);
    return d->settings.status() == QSettings::NoError;
}

bool MFileDataStore::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.

Definition at line 280 of file mfiledatastore.cpp.

{
    Q_D(const MFileDataStore);
    return d->settings.isWritable() && d->settings.status() == QSettings::NoError;
}


Member Data Documentation

MFileDataStorePrivate* const MFileDataStore::d_ptr [protected]

Definition at line 118 of file corelib/core/mfiledatastore.h.


Copyright © 2010 Nokia Corporation Generated on Thu Nov 4 2010 18:14:25 (PDT)
Doxygen 1.7.1
MeeGo Touch