25#ifndef SCSL_DICTIONARY_H
26#define SCSL_DICTIONARY_H
35static constexpr uint8_t DICTIONARY_TAG_KEY = 1;
36static constexpr uint8_t DICTIONARY_TAG_VAL = 2;
55 kTag(DICTIONARY_TAG_KEY),
56 vTag(DICTIONARY_TAG_VAL)
93 int Set(
const char *key, uint8_t klen,
const char *val,
108 bool Delete(
const char *key, uint8_t klen);
126 uint8_t *seek(
const char *key, uint8_t klen);
128 bool spaceAvailable(uint8_t klen, uint8_t vlen);
Memory management using an arena.
TLV.h implements basic tag-length-value records.
Fixed, pre-allocated memory.
Definition Arena.h:74
Key-value store on top of Arena and TLV::Record.
Definition Dictionary.h:48
Dictionary(Arena &arena, uint8_t kt, uint8_t vt)
Definition Dictionary.h:64
Dictionary(Arena &arena)
Definition Dictionary.h:53
friend std::ostream & operator<<(std::ostream &os, const Dictionary &dictionary)
bool Lookup(const char *key, uint8_t klen, TLV::Record &res)
bool Contains(const char *key, uint8_t klen)
int Set(const char *key, uint8_t klen, const char *val, uint8_t vlen)
bool Delete(const char *key, uint8_t klen)
int DumpToFile(const char *path)
scsl is the top-level namespace containing all the code in this library.
Definition scsl.h:43
Tag-length-value record with single byte tags and lengths.
Definition TLV.h:42