diff options
Diffstat (limited to 'common/storage_common.cpp')
-rw-r--r-- | common/storage_common.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/common/storage_common.cpp b/common/storage_common.cpp index 246611c..6263bf2 100644 --- a/common/storage_common.cpp +++ b/common/storage_common.cpp | |||
@@ -9,6 +9,11 @@ void errorHandler(const Storage::Error &error) | |||
9 | std::cerr << "Read error in " << error.store << ", code " << error.code << ", message: " << error.message << std::endl; | 9 | std::cerr << "Read error in " << error.store << ", code " << error.code << ", message: " << error.message << std::endl; |
10 | } | 10 | } |
11 | 11 | ||
12 | std::function<void(const Storage::Error &error)> Storage::basicErrorHandler() | ||
13 | { | ||
14 | return errorHandler; | ||
15 | } | ||
16 | |||
12 | void Storage::read(const std::string &sKey, const std::function<bool(const std::string &value)> &resultHandler) | 17 | void Storage::read(const std::string &sKey, const std::function<bool(const std::string &value)> &resultHandler) |
13 | { | 18 | { |
14 | read(sKey, resultHandler, &errorHandler); | 19 | read(sKey, resultHandler, &errorHandler); |
@@ -21,6 +26,6 @@ void Storage::read(const std::string &sKey, const std::function<bool(void *ptr, | |||
21 | 26 | ||
22 | void Storage::scan(const std::string &sKey, const std::function<bool(void *keyPtr, int keySize, void *valuePtr, int valueSize)> &resultHandler) | 27 | void Storage::scan(const std::string &sKey, const std::function<bool(void *keyPtr, int keySize, void *valuePtr, int valueSize)> &resultHandler) |
23 | { | 28 | { |
24 | scan(sKey, resultHandler, &errorHandler); | 29 | scan(sKey.data(), sKey.size(), resultHandler, &errorHandler); |
25 | } | 30 | } |
26 | 31 | ||