![]() |
Mbed OS Reference
|
Data Structures | |
| struct | info |
| The key size. More... | |
Typedefs | |
| typedef struct info | kv_info_t |
| The key size. | |
Functions | |
| int | kv_set (const char *full_name_key, const void *buffer, size_t size, uint32_t create_flags) |
| Set one KVStore item, given key and value. | |
| int | kv_get (const char *full_name_key, void *buffer, size_t buffer_size, size_t *actual_size) |
| Get one KVStore item by given key. | |
| int | kv_get_info (const char *full_name_key, kv_info_t *info) |
| Get information of a given key.The returned info contains size and flags. | |
| int | kv_remove (const char *full_name_key) |
| Remove a KVStore item by given key. | |
| int | kv_iterator_open (kv_iterator_t *it, const char *full_prefix) |
| Start an iteration over KVStore keys to find all the entries that fit the full_prefix. | |
| int | kv_iterator_next (kv_iterator_t it, char *key, size_t key_size) |
| Get next key in iteration that matches the prefix. | |
| int | kv_iterator_close (kv_iterator_t it) |
| Close iteration and deallocate the iterator handle. | |
| int | kv_reset (const char *kvstore_path) |
| Remove all keys and related data from a specified partition. | |
| int kv_set | ( | const char * | full_name_key, |
| const void * | buffer, | ||
| size_t | size, | ||
| uint32_t | create_flags | ||
| ) |
Set one KVStore item, given key and value.
| [in] | full_name_key | /Partition_path/Key. Must not include '*' '/' '?' ':' ';' '\' '"' '|' ' ' '<' '>' '\'. |
| [in] | buffer | Value data buffer. |
| [in] | size | Value data size. |
| [in] | create_flags | Flag mask. |
| int kv_get | ( | const char * | full_name_key, |
| void * | buffer, | ||
| size_t | buffer_size, | ||
| size_t * | actual_size | ||
| ) |
Get one KVStore item by given key.
| [in] | full_name_key | /Partition_path/Key. Must not include '*' '/' '?' ':' ';' '\' '"' '|' ' ' '<' '>' '\'. |
| [in] | buffer | Value data buffer. |
| [in] | buffer_size | Value data buffer size. |
| [out] | actual_size | Actual read size. |
| int kv_get_info | ( | const char * | full_name_key, |
| kv_info_t * | info | ||
| ) |
Get information of a given key.The returned info contains size and flags.
| [in] | full_name_key | /Partition_path/Key. Must not include '*' '/' '?' ':' ';' '\' '"' '|' ' ' '<' '>' '\'. |
| [out] | info | Returned information structure. |
| int kv_remove | ( | const char * | full_name_key | ) |
Remove a KVStore item by given key.
| [in] | full_name_key | /Partition_path/Key. Must not include '*' '/' '?' ':' ';' '\' '"' '|' ' ' '<' '>' '\'. |
| int kv_iterator_open | ( | kv_iterator_t * | it, |
| const char * | full_prefix | ||
| ) |
Start an iteration over KVStore keys to find all the entries that fit the full_prefix.
There are no issues with any other operations while iterator is open.
| [out] | it | Allocating iterator handle. Do not forget to call kv_iterator_close to deallocate the memory. |
| [in] | full_prefix | full_prefix Partition/Key prefix. If empty key or NULL pointer, all keys will match. |
| int kv_iterator_next | ( | kv_iterator_t | it, |
| char * | key, | ||
| size_t | key_size | ||
| ) |
Get next key in iteration that matches the prefix.
There are no issues with any other operations while iterator is open.
| [in] | it | Iterator handle. |
| [in] | key | Buffer for returned key. |
| [in] | key_size | Key buffer size. |
| int kv_iterator_close | ( | kv_iterator_t | it | ) |
Close iteration and deallocate the iterator handle.
| [in] | it | Iterator handle. |
| int kv_reset | ( | const char * | kvstore_path | ) |
Remove all keys and related data from a specified partition.
| [in] | kvstore_path | /Partition/ |