12 virtual bool save(
const uint8_t *data,
size_t len) = 0;
13 virtual bool load(uint8_t *data,
size_t len) = 0;
21 template<
typename T>
bool save(
const T *src) {
24 return backend_->
save(
reinterpret_cast<const uint8_t *
>(src),
sizeof(T));
27 template<
typename T>
bool load(T *dest) {
30 return backend_->
load(
reinterpret_cast<uint8_t *
>(dest),
sizeof(T));
57 template<typename T, enable_if_t<is_trivially_copyable<T>::value,
bool> =
true>
62 template<typename T, enable_if_t<is_trivially_copyable<T>::value,
bool> =
true>
virtual bool load(uint8_t *data, size_t len)=0
virtual bool save(const uint8_t *data, size_t len)=0
ESPPreferenceObject(ESPPreferenceBackend *backend)
ESPPreferenceObject()=default
ESPPreferenceBackend * backend_
virtual bool sync()=0
Commit pending writes to flash.
ESPPreferenceObject make_preference(uint32_t type)
virtual bool reset()=0
Forget all unsaved changes and re-initialize the permanent preferences storage.
virtual ESPPreferenceObject make_preference(size_t length, uint32_t type)=0
ESPPreferenceObject make_preference(uint32_t type, bool in_flash)
virtual ESPPreferenceObject make_preference(size_t length, uint32_t type, bool in_flash)=0
Providing packet encoding functions for exchanging data with a remote host.
ESPPreferences * global_preferences