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