瀏覽代碼

多字段-Put_fields,Get_fields,FindKeysByField

master
陈予曈 8 月之前
父節點
當前提交
cd0c2bb557
共有 1 個檔案被更改,包括 12 行新增0 行删除
  1. +12
    -0
      include/leveldb/db.h

+ 12
- 0
include/leveldb/db.h 查看文件

@ -7,6 +7,7 @@
#include <cstdint>
#include <cstdio>
#include <vector>
#include "leveldb/export.h"
#include "leveldb/iterator.h"
@ -14,6 +15,9 @@
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
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<std::string> 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).

Loading…
取消
儲存