refs #494 Get the filename used for serializing a specific cached value, or list of all files used by whole cache.

This commit is contained in:
Mathew Sutcliffe
2015-10-22 02:02:28 +01:00
parent 8a3cb5f661
commit 0ca4797bcf
7 changed files with 72 additions and 0 deletions

View File

@@ -34,6 +34,12 @@ namespace BlackCore
//! The directory where core data are stored.
static const QString &persistentStore();
//! Return the filename where the value with the given key may be stored.
static QString filenameForKey(const QString &key);
//! Return all files where data may be stored.
QStringList enumerateStore() const;
private:
CDataCache();
@@ -75,6 +81,9 @@ namespace BlackCore
//! Reset the data to its default value.
void setDefault() { this->set(Trait::defaultValue()); }
//! Return the file that is used for persistence for this value.
QString getFilename() const { return CDataCache::filenameForKey(this->getKey()); }
};
/*!