MCPcopy Create free account
hub / github.com/ElementsProject/elements / leveldb_get

Function leveldb_get

src/leveldb/db/c.cc:198–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196}
197
198char* leveldb_get(leveldb_t* db, const leveldb_readoptions_t* options,
199 const char* key, size_t keylen, size_t* vallen,
200 char** errptr) {
201 char* result = nullptr;
202 std::string tmp;
203 Status s = db->rep->Get(options->rep, Slice(key, keylen), &tmp);
204 if (s.ok()) {
205 *vallen = tmp.size();
206 result = CopyString(tmp);
207 } else {
208 *vallen = 0;
209 if (!s.IsNotFound()) {
210 SaveError(errptr, s);
211 }
212 }
213 return result;
214}
215
216leveldb_iterator_t* leveldb_create_iterator(
217 leveldb_t* db, const leveldb_readoptions_t* options) {

Callers 1

CheckGetFunction · 0.85

Calls 5

CopyStringFunction · 0.85
SaveErrorFunction · 0.85
SliceClass · 0.50
GetMethod · 0.45
sizeMethod · 0.45

Tested by 1

CheckGetFunction · 0.68