summaryrefslogtreecommitdiffstats
path: root/common/storage.h
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2014-12-10 21:54:04 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2014-12-10 21:54:04 +0100
commit95801103c1fc773b074eea1b2d03820099ac09a6 (patch)
treeb55445cddc451b68ff171fceb729e4cc602b2531 /common/storage.h
parent4911df72dbc202dfcc4c64bb0ba311d7513707ae (diff)
downloadsink-95801103c1fc773b074eea1b2d03820099ac09a6.tar.gz
sink-95801103c1fc773b074eea1b2d03820099ac09a6.zip
Storage: implemented scan
This can replace all our read calls. Note that we need a different API for databases where the value needs to be loaded first, so we can do a key scan before loading values. With this we can do key + value scans in one though.
Diffstat (limited to 'common/storage.h')
-rw-r--r--common/storage.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/storage.h b/common/storage.h
index e5e592c..55688d4 100644
--- a/common/storage.h
+++ b/common/storage.h
@@ -34,6 +34,10 @@ public:
34 void read(const std::string &sKey, 34 void read(const std::string &sKey,
35 const std::function<bool(void *ptr, int size)> & resultHandler, 35 const std::function<bool(void *ptr, int size)> & resultHandler,
36 const std::function<void(const Storage::Error &error)> &errorHandler); 36 const std::function<void(const Storage::Error &error)> &errorHandler);
37 void scan(const std::string &sKey, const std::function<bool(void *keyPtr, int keySize, void *valuePtr, int valueSize)> &resultHandler);
38 void scan(const std::string &sKey,
39 const std::function<bool(void *keyPtr, int keySize, void *valuePtr, int valueSize)> & resultHandler,
40 const std::function<void(const Storage::Error &error)> &errorHandler);
37 41
38 qint64 diskUsage() const; 42 qint64 diskUsage() const;
39 void removeFromDisk() const; 43 void removeFromDisk() const;