18#ifndef MBED_FILE_SYSTEM_STORE_H
19#define MBED_FILE_SYSTEM_STORE_H
21#include "kvstore/KVStore.h"
22#include "filesystem/FileSystem.h"
96 virtual int set(
const char *key,
const void *buffer,
size_t size, uint32_t create_flags);
115 virtual int get(
const char *key,
void *buffer,
size_t buffer_size,
size_t *actual_size = NULL,
size_t offset = 0);
163 virtual int set_start(set_handle_t *handle,
const char *key,
size_t final_data_size, uint32_t create_flags);
180 virtual int set_add_data(set_handle_t handle,
const void *value_data,
size_t data_size);
233#if !defined(DOXYGEN_ONLY)
239 uint16_t metadata_size;
251 int _build_full_path_key(
const char *key_src);
262 int _verify_key_file(
const char *key, key_metadata_t *key_metadata,
File *kv_file);
268 bool _is_initialized;
270 size_t _cfg_fs_path_size;
271 char *_full_path_key;
272 size_t _cur_inc_data_size;
273 set_handle_t _cur_inc_set_handle;
FileSystemStore is a lightweight implementation of the KVStore interface over file systems.
virtual int get_info(const char *key, info_t *info)
Get information of a given key.
virtual int iterator_open(iterator_t *it, const char *prefix=NULL)
Start an iteration over FileSystemStore keys.
virtual int remove(const char *key)
Remove a FileSystemStore item by given key.
virtual int iterator_next(iterator_t it, char *key, size_t key_size)
Get next key in iteration.
virtual int set_finalize(set_handle_t handle)
Finalize an incremental FileSystemStore set sequence.
virtual int set(const char *key, const void *buffer, size_t size, uint32_t create_flags)
Set one FileSystemStore item, given key and value.
virtual ~FileSystemStore()
Destroy FileSystemStore instance.
virtual int iterator_close(iterator_t it)
Close iteration.
FileSystemStore(FileSystem *fs)
Create FileSystemStore - A Key Value API on top of FS.
virtual int set_start(set_handle_t *handle, const char *key, size_t final_data_size, uint32_t create_flags)
Start an incremental FileSystemStore set sequence.
virtual int deinit()
Deinitialize FileSystemStore, release and free resources.
virtual int reset()
Reset FileSystemStore contents (clear all keys)
virtual int get(const char *key, void *buffer, size_t buffer_size, size_t *actual_size=NULL, size_t offset=0)
Get one FileSystemStore item by given key.
virtual int set_add_data(set_handle_t handle, const void *value_data, size_t data_size)
Add data to incremental FileSystemStore set sequence.
virtual int init()
Initialize FileSystemStore, checking validity of KVStore writing folder and if it doesn't exist,...
The Mutex class is used to synchronize the execution of threads.