45 enum class Type : uint8_t {
74 void Write(std::ostream& dst)
const;
81 bool Has(
const std::string& key)
const;
88 const Entry&
Get(
const std::string& key)
const;
96 void Set(
const std::string& key,
Type type, std::vector<uint8_t>&& value);
103 std::vector<uint8_t>
GetBytes(
const std::string& key)
const;
123 std::map<std::string, Entry>
entries()
const {
return entries_; }
126 std::map<std::string, Entry> entries_;
A typed key-value store used in KDBX 4 header fields.
Definition variantdictionary.hh:42
const Entry & Get(const std::string &key) const
Returns the entry associated with key.
std::map< std::string, Entry > entries() const
Returns a copy of all entries in the dictionary.
Definition variantdictionary.hh:123
bool Has(const std::string &key) const
Checks whether an entry with the given key exists.
std::vector< uint8_t > GetBytes(const std::string &key) const
Returns the raw value bytes of an entry.
void Set(const std::string &key, Type type, std::vector< uint8_t > &&value)
Inserts or replaces an entry in the dictionary.
void Parse(std::istream &src)
Deserializes the dictionary from a binary stream.
uint32_t GetUInt32(const std::string &key) const
Returns the value of an entry interpreted as a uint32.
Type
Type tags identifying the value kind stored in an entry.
Definition variantdictionary.hh:45
void Write(std::ostream &dst) const
Serializes the dictionary to a binary stream.
uint64_t GetUInt64(const std::string &key) const
Returns the value of an entry interpreted as a uint64.
Visibility/export macro for the shared library.
#define LIBKEEPASS_API
Marks a class, function or variable as part of the public ABI.
Definition export.hh:43
A single entry in the dictionary, holding a typed value.
Definition variantdictionary.hh:59
std::vector< uint8_t > value
Raw serialized value bytes.
Definition variantdictionary.hh:61