|
Ersa Wearable Platform
Embedded smartwatch firmware and application framework
|
#include <storage_service.h>

Public Member Functions | |
| virtual | ~StorageService ()=default |
| virtual Result< void > | init ()=0 |
| virtual bool | setString (std::string_view key, std::string_view value)=0 |
| virtual std::string | getString (std::string_view key, std::string_view defaultValue="")=0 |
| virtual bool | setInt (std::string_view key, int32_t value)=0 |
| virtual int32_t | getInt (std::string_view key, int32_t defaultValue=0)=0 |
| virtual bool | setBool (std::string_view key, bool value)=0 |
| virtual bool | getBool (std::string_view key, bool defaultValue=false)=0 |
| virtual bool | setBytes (std::string_view key, const void *data, size_t size)=0 |
| virtual size_t | getBytesLength (std::string_view key)=0 |
| virtual size_t | getBytes (std::string_view key, void *data, size_t size)=0 |
| virtual bool | remove (std::string_view key)=0 |
| virtual void | clear ()=0 |
Static Public Member Functions | |
| static StorageService & | instance () |
| Return the installed process-wide storage service. | |
| static void | setInstance (StorageService *instance) |
| Install the process-wide storage backend. | |
Typed persistent key/value contract used by settings and app state.
The interface avoids exposing NVS, filesystems, or host test storage details. Values are stored by key and implementations decide the physical medium; callers must inspect write results when persistence matters and use defaults when keys are absent, which supports first-boot and schema migration paths.
|
virtualdefault |
|
pure virtual |
Clear this service's namespace; use carefully because it removes all keys.
Implemented in ersa::services::MemoryStorageService.
|
pure virtual |
Read a boolean setting or return defaultValue when the key is absent.
Implemented in ersa::services::MemoryStorageService.
|
pure virtual |
Copy a stored record when its size matches; return bytes copied or zero.
Implemented in ersa::services::MemoryStorageService.
|
pure virtual |
Return the exact stored record size, or zero when the key is absent.
Implemented in ersa::services::MemoryStorageService.
|
pure virtual |
Read a signed integer or return defaultValue for an absent key.
Implemented in ersa::services::MemoryStorageService.
|
pure virtual |
Return the stored value or a copy of defaultValue when key is absent.
Implemented in ersa::services::MemoryStorageService.
|
pure virtual |
Mount/open the backend and prepare its namespace for reads and writes.
Implemented in ersa::services::MemoryStorageService.
|
static |
Return the installed process-wide storage service.
|
pure virtual |
Remove one key; false means no removal was made or the backend failed.
Implemented in ersa::services::MemoryStorageService.
|
pure virtual |
Store a boolean setting; false indicates that persistence failed.
Implemented in ersa::services::MemoryStorageService.
|
pure virtual |
Store an opaque byte record for bounded caches and versioned snapshots.
Implemented in ersa::services::MemoryStorageService.
|
static |
Install the process-wide storage backend.
|
pure virtual |
Store a signed integer using the backend's typed representation.
Implemented in ersa::services::MemoryStorageService.
|
pure virtual |
Store a string; false reports backend failure or exhausted storage.
Implemented in ersa::services::MemoryStorageService.