A typed key-value store used in KDBX 4 header fields.
More...
#include <variantdictionary.hh>
|
| struct | Entry |
| | A single entry in the dictionary, holding a typed value. More...
|
| |
A typed key-value store used in KDBX 4 header fields.
Format reference: https://sseemayer.github.io/kdbx-compendium/
◆ Type
Type tags identifying the value kind stored in an entry.
| Enumerator |
|---|
| kEnd | End-of-dictionary sentinel.
|
| kUInt32 | Unsigned 32-bit integer.
|
| kUInt64 | Unsigned 64-bit integer.
|
| kBool | Boolean value.
|
| kInt32 | Signed 32-bit integer.
|
| kInt64 | Signed 64-bit integer.
|
| kString | UTF-8 string.
|
| kByteArray | Raw byte array.
|
◆ entries()
| std::map< std::string, Entry > keepass::VariantDictionary::entries |
( |
| ) |
const |
|
inline |
Returns a copy of all entries in the dictionary.
- Returns
- Map of key-value pairs.
◆ Get()
| const Entry & keepass::VariantDictionary::Get |
( |
const std::string & |
key | ) |
const |
Returns the entry associated with key.
- Parameters
-
| [in] | key | Entry key to look up. |
- Returns
- Const reference to the matching entry.
◆ GetBytes()
| std::vector< uint8_t > keepass::VariantDictionary::GetBytes |
( |
const std::string & |
key | ) |
const |
Returns the raw value bytes of an entry.
- Parameters
-
| [in] | key | Entry key to look up. |
- Returns
- Copy of the value byte vector.
◆ GetUInt32()
| uint32_t keepass::VariantDictionary::GetUInt32 |
( |
const std::string & |
key | ) |
const |
Returns the value of an entry interpreted as a uint32.
- Parameters
-
| [in] | key | Entry key to look up. |
- Returns
- The value as uint32_t.
◆ GetUInt64()
| uint64_t keepass::VariantDictionary::GetUInt64 |
( |
const std::string & |
key | ) |
const |
Returns the value of an entry interpreted as a uint64.
- Parameters
-
| [in] | key | Entry key to look up. |
- Returns
- The value as uint64_t.
◆ Has()
| bool keepass::VariantDictionary::Has |
( |
const std::string & |
key | ) |
const |
Checks whether an entry with the given key exists.
- Parameters
-
| [in] | key | Entry key to look up. |
- Returns
- true if the key is present, false otherwise.
◆ Parse()
| void keepass::VariantDictionary::Parse |
( |
std::istream & |
src | ) |
|
Deserializes the dictionary from a binary stream.
- Parameters
-
| [in,out] | src | Input stream to read from. |
◆ Set()
| void keepass::VariantDictionary::Set |
( |
const std::string & |
key, |
|
|
Type |
type, |
|
|
std::vector< uint8_t > && |
value |
|
) |
| |
Inserts or replaces an entry in the dictionary.
- Parameters
-
| [in] | key | Entry key. |
| [in] | type | Data type of the value. |
| [in] | value | Raw serialized value bytes (moved in). |
◆ Write()
| void keepass::VariantDictionary::Write |
( |
std::ostream & |
dst | ) |
const |
Serializes the dictionary to a binary stream.
- Parameters
-
| [out] | dst | Output stream to write to. |
The documentation for this class was generated from the following file: