diff options
Diffstat (limited to 'store/database.h')
-rw-r--r-- | store/database.h | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/store/database.h b/store/database.h deleted file mode 100644 index 1cede39..0000000 --- a/store/database.h +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include <string> | ||
4 | #include <QString> | ||
5 | |||
6 | class Database { | ||
7 | public: | ||
8 | enum TransactionType { ReadOnly, ReadWrite }; | ||
9 | |||
10 | Database(const QString &storageRoot, const QString &name); | ||
11 | ~Database(); | ||
12 | bool isInTransaction() const; | ||
13 | bool startTransaction(TransactionType type = ReadWrite); | ||
14 | bool commitTransaction(); | ||
15 | void abortTransaction(); | ||
16 | bool write(const char *key, size_t keySize, const char *value, size_t valueSize); | ||
17 | bool write(const std::string &sKey, const std::string &sValue); | ||
18 | //Perhaps prefer iterators (assuming we need to be able to match multiple values | ||
19 | bool read(const std::string &sKey, const std::function<void(const std::string &value)> &); | ||
20 | bool read(const std::string &sKey, const std::function<void(void *ptr, int size)> &); | ||
21 | |||
22 | qint64 diskUsage() const; | ||
23 | void removeFromDisk() const; | ||
24 | private: | ||
25 | class Private; | ||
26 | Private * const d; | ||
27 | }; | ||
28 | |||