diff options
author | Aaron Seigo <aseigo@kde.org> | 2014-12-04 19:23:09 +0100 |
---|---|---|
committer | Aaron Seigo <aseigo@kde.org> | 2014-12-04 19:23:09 +0100 |
commit | f57dca821e2a33783ec0dd0af2f5c31daef4fa64 (patch) | |
tree | c96de4486a3278cad2e13724e0c33d04d005f00c /store/database.h | |
parent | 3ff320c9f11a4c51164adeb8a2b098aec22742c3 (diff) | |
download | sink-f57dca821e2a33783ec0dd0af2f5c31daef4fa64.tar.gz sink-f57dca821e2a33783ec0dd0af2f5c31daef4fa64.zip |
kyoto!
Diffstat (limited to 'store/database.h')
-rw-r--r-- | store/database.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/store/database.h b/store/database.h index 2bf0556..e752ff5 100644 --- a/store/database.h +++ b/store/database.h | |||
@@ -7,17 +7,20 @@ class Database { | |||
7 | public: | 7 | public: |
8 | enum TransactionType { ReadOnly, ReadWrite }; | 8 | enum TransactionType { ReadOnly, ReadWrite }; |
9 | 9 | ||
10 | Database(const QString &path); | 10 | Database(const QString &storageRoot, const QString &name); |
11 | ~Database(); | 11 | ~Database(); |
12 | bool isInTransaction() const; | 12 | bool isInTransaction() const; |
13 | bool startTransaction(TransactionType type = ReadWrite); | 13 | bool startTransaction(TransactionType type = ReadWrite); |
14 | bool commitTransaction(); | 14 | bool commitTransaction(); |
15 | void abortTransaction(); | 15 | void abortTransaction(); |
16 | bool write(const char *key, size_t keySize, const char *value, size_t valueSize); | ||
16 | bool write(const std::string &sKey, const std::string &sValue); | 17 | bool write(const std::string &sKey, const std::string &sValue); |
17 | //Perhaps prefer iterators (assuming we need to be able to match multiple values | 18 | //Perhaps prefer iterators (assuming we need to be able to match multiple values |
18 | void read(const std::string &sKey, const std::function<void(const std::string &value)> &); | 19 | void read(const std::string &sKey, const std::function<void(const std::string &value)> &); |
19 | void read(const std::string &sKey, const std::function<void(void *ptr, int size)> &); | 20 | void read(const std::string &sKey, const std::function<void(void *ptr, int size)> &); |
20 | 21 | ||
22 | qint64 diskUsage() const; | ||
23 | void removeFromDisk() const; | ||
21 | private: | 24 | private: |
22 | class Private; | 25 | class Private; |
23 | Private * const d; | 26 | Private * const d; |