summaryrefslogtreecommitdiffstats
path: root/store/database.h
diff options
context:
space:
mode:
Diffstat (limited to 'store/database.h')
-rw-r--r--store/database.h5
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 {
7public: 7public:
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;
21private: 24private:
22 class Private; 25 class Private;
23 Private * const d; 26 Private * const d;