From f57dca821e2a33783ec0dd0af2f5c31daef4fa64 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Thu, 4 Dec 2014 19:23:09 +0100 Subject: kyoto! --- store/database.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'store/database.h') 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 { public: enum TransactionType { ReadOnly, ReadWrite }; - Database(const QString &path); + Database(const QString &storageRoot, const QString &name); ~Database(); bool isInTransaction() const; bool startTransaction(TransactionType type = ReadWrite); bool commitTransaction(); void abortTransaction(); + bool write(const char *key, size_t keySize, const char *value, size_t valueSize); bool write(const std::string &sKey, const std::string &sValue); //Perhaps prefer iterators (assuming we need to be able to match multiple values void read(const std::string &sKey, const std::function &); void read(const std::string &sKey, const std::function &); + qint64 diskUsage() const; + void removeFromDisk() const; private: class Private; Private * const d; -- cgit v1.2.3 From 767312e2063f4e58af3de0f27aba52de49e14295 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Fri, 5 Dec 2014 09:17:46 +0100 Subject: major reorg that puts Storage (previously Database) into common there is now a top-level tests dir, and a compile time switch for lmdb vs kyotocabinet --- store/database.h | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 store/database.h (limited to 'store/database.h') diff --git a/store/database.h b/store/database.h deleted file mode 100644 index e752ff5..0000000 --- a/store/database.h +++ /dev/null @@ -1,28 +0,0 @@ -#pragma once - -#include -#include - -class Database { -public: - enum TransactionType { ReadOnly, ReadWrite }; - - Database(const QString &storageRoot, const QString &name); - ~Database(); - bool isInTransaction() const; - bool startTransaction(TransactionType type = ReadWrite); - bool commitTransaction(); - void abortTransaction(); - bool write(const char *key, size_t keySize, const char *value, size_t valueSize); - bool write(const std::string &sKey, const std::string &sValue); - //Perhaps prefer iterators (assuming we need to be able to match multiple values - void read(const std::string &sKey, const std::function &); - void read(const std::string &sKey, const std::function &); - - qint64 diskUsage() const; - void removeFromDisk() const; -private: - class Private; - Private * const d; -}; - -- cgit v1.2.3