prf::config::IConfigBackend class

Abstract storage backend used by ConfigStore.

The backend owns persistence details, while ConfigStore owns schema validation, defaults, and dirty-state logic.

Derived classes

class PicoLittleFsConfigBackend final
PicoSDK flash backend that stores config section files in LittleFS.
class UnixFileConfigBackend final

Constructors, destructors, conversion operators

~IConfigBackend() defaulted virtual

Public functions

auto read_file(std::string_view relative_path, std::vector<uint8_t>* out_bytes) -> ConfigReadStatus pure virtual
Reads raw section payload bytes.
auto remove_file(std::string_view relative_path) -> bool pure virtual
Removes one persisted file.
auto write_file_atomic(std::string_view relative_path, const std::vector<uint8_t>& bytes) -> bool pure virtual
Writes bytes using backend-specific atomic replacement.

Function documentation

ConfigReadStatus prf::config::IConfigBackend::read_file(std::string_view relative_path, std::vector<uint8_t>* out_bytes) pure virtual

Reads raw section payload bytes.

Parameters
relative_path Backend-relative file path, for example npr1.cbor.
out_bytes Output byte buffer that receives file contents.
Returns Ok when file was read, NotFound when file does not exist, or Error on storage failure.

bool prf::config::IConfigBackend::remove_file(std::string_view relative_path) pure virtual

Removes one persisted file.

Missing files should be treated as success by concrete backends.

bool prf::config::IConfigBackend::write_file_atomic(std::string_view relative_path, const std::vector<uint8_t>& bytes) pure virtual

Writes bytes using backend-specific atomic replacement.

The old content must remain intact when this method fails.