|
@ -7,6 +7,7 @@ |
|
|
|
|
|
|
|
|
#include <cstdint> |
|
|
#include <cstdint> |
|
|
#include <cstdio> |
|
|
#include <cstdio> |
|
|
|
|
|
#include <vector> |
|
|
|
|
|
|
|
|
#include "leveldb/export.h" |
|
|
#include "leveldb/export.h" |
|
|
#include "leveldb/iterator.h" |
|
|
#include "leveldb/iterator.h" |
|
@ -14,6 +15,9 @@ |
|
|
|
|
|
|
|
|
namespace leveldb { |
|
|
namespace leveldb { |
|
|
|
|
|
|
|
|
|
|
|
using Field = std::pair<std::string, std::string>; |
|
|
|
|
|
using FieldArray = std::vector<std::pair<std::string, std::string>>; |
|
|
|
|
|
|
|
|
// Update CMakeLists.txt if you change these |
|
|
// Update CMakeLists.txt if you change these |
|
|
static const int kMajorVersion = 1; |
|
|
static const int kMajorVersion = 1; |
|
|
static const int kMinorVersion = 23; |
|
|
static const int kMinorVersion = 23; |
|
@ -87,6 +91,14 @@ class LEVELDB_EXPORT DB { |
|
|
virtual Status Get(const ReadOptions& options, const Slice& key, |
|
|
virtual Status Get(const ReadOptions& options, const Slice& key, |
|
|
std::string* value) = 0; |
|
|
std::string* value) = 0; |
|
|
|
|
|
|
|
|
|
|
|
virtual Status Put_fields(const WriteOptions& options, const Slice& key, |
|
|
|
|
|
const FieldArray& fields) = 0; |
|
|
|
|
|
|
|
|
|
|
|
virtual Status Get_fields(const ReadOptions& options, const Slice& key, |
|
|
|
|
|
FieldArray* fields) = 0; |
|
|
|
|
|
|
|
|
|
|
|
virtual std::vector<std::string> FindKeysByField(leveldb::DB* db, Field &field) = 0; |
|
|
|
|
|
|
|
|
// Return a heap-allocated iterator over the contents of the database. |
|
|
// Return a heap-allocated iterator over the contents of the database. |
|
|
// The result of NewIterator() is initially invalid (caller must |
|
|
// The result of NewIterator() is initially invalid (caller must |
|
|
// call one of the Seek methods on the iterator before using it). |
|
|
// call one of the Seek methods on the iterator before using it). |
|
|