summaryrefslogtreecommitdiffstats
path: root/store/database.h
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2014-12-04 23:04:02 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2014-12-04 23:04:02 +0100
commitd8966b7d703cc34dd71ca7688b3d0f08c7a2a902 (patch)
tree0c455125bd18495432f2c074cd21d07ca772a540 /store/database.h
parent838bc745bbce58ec5892c453971d5f7bd48f74ff (diff)
downloadsink-d8966b7d703cc34dd71ca7688b3d0f08c7a2a902.tar.gz
sink-d8966b7d703cc34dd71ca7688b3d0f08c7a2a902.zip
Adapted to new interface.
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;