ESPHome  2024.10.2
Public Member Functions | Protected Member Functions | Protected Attributes
esphome::host::HostPreferences Class Reference

#include <preferences.h>

Inheritance diagram for esphome::host::HostPreferences:
esphome::ESPPreferences

Public Member Functions

bool sync () override
 
bool reset () override
 
ESPPreferenceObject make_preference (size_t length, uint32_t type, bool in_flash) override
 
ESPPreferenceObject make_preference (size_t length, uint32_t type) override
 
bool save (uint32_t key, const uint8_t *data, size_t len)
 
bool load (uint32_t key, uint8_t *data, size_t len)
 
- Public Member Functions inherited from esphome::ESPPreferences
template<typename T , enable_if_t< is_trivially_copyable< T >::value, bool > = true>
ESPPreferenceObject make_preference (uint32_t type, bool in_flash)
 
template<typename T , enable_if_t< is_trivially_copyable< T >::value, bool > = true>
ESPPreferenceObject make_preference (uint32_t type)
 

Protected Member Functions

void setup_ ()
 

Protected Attributes

bool setup_complete_ {}
 
std::string filename_ {}
 
std::map< uint32_t, std::vector< uint8_t > > data {}
 

Detailed Description

Definition at line 22 of file preferences.h.

Member Function Documentation

◆ load()

bool esphome::host::HostPreferences::load ( uint32_t  key,
uint8_t *  data,
size_t  len 
)
inline

Definition at line 41 of file preferences.h.

◆ make_preference() [1/2]

ESPPreferenceObject esphome::host::HostPreferences::make_preference ( size_t  length,
uint32_t  type,
bool  in_flash 
)
overridevirtual

Implements esphome::ESPPreferences.

Definition at line 64 of file preferences.cpp.

◆ make_preference() [2/2]

ESPPreferenceObject esphome::host::HostPreferences::make_preference ( size_t  length,
uint32_t  type 
)
inlineoverridevirtual

Implements esphome::ESPPreferences.

Definition at line 28 of file preferences.h.

◆ reset()

bool esphome::host::HostPreferences::reset ( )
overridevirtual

Implements esphome::ESPPreferences.

Definition at line 59 of file preferences.cpp.

◆ save()

bool esphome::host::HostPreferences::save ( uint32_t  key,
const uint8_t *  data,
size_t  len 
)
inline

Definition at line 32 of file preferences.h.

◆ setup_()

void esphome::host::HostPreferences::setup_ ( )
protected

Definition at line 14 of file preferences.cpp.

◆ sync()

bool esphome::host::HostPreferences::sync ( )
overridevirtual

Implements esphome::ESPPreferences.

Definition at line 44 of file preferences.cpp.

Field Documentation

◆ data

std::map<uint32_t, std::vector<uint8_t> > esphome::host::HostPreferences::data {}
protected

Definition at line 58 of file preferences.h.

◆ filename_

std::string esphome::host::HostPreferences::filename_ {}
protected

Definition at line 57 of file preferences.h.

◆ setup_complete_

bool esphome::host::HostPreferences::setup_complete_ {}
protected

Definition at line 56 of file preferences.h.


The documentation for this class was generated from the following files: