|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
RAII wrapper for an NVS handle. More...
#include <Raii.h>
Public Member Functions | |
| NvsScope () noexcept=default | |
| Construct an empty, closed scope. Status reports ESP_FAIL until opened. | |
| NvsScope (const char *ns, nvs_open_mode_t mode) noexcept | |
Open ns in mode. Errors are silent; use bool conversion or status() to check. | |
| ~NvsScope () noexcept | |
| NvsScope (const NvsScope &)=delete | |
| NvsScope & | operator= (const NvsScope &)=delete |
| NvsScope (NvsScope &&other) noexcept | |
| NvsScope & | operator= (NvsScope &&other) noexcept |
| operator bool () const noexcept | |
| True if the namespace was opened successfully. | |
| operator nvs_handle_t () const noexcept | |
| Raw handle for the underlying nvs_* functions. | |
| esp_err_t | status () const noexcept |
| esp_err_t result of the original nvs_open call. | |
| esp_err_t | commit () noexcept |
| Commit pending writes. Caller checks the return value if needed. | |
| void | close () noexcept |
| Manually close before destruction. Idempotent. | |
RAII wrapper for an NVS handle.
Opens the given namespace in the constructor and closes it in the destructor. Non-copyable. Use bool conversion to check whether the open succeeded.
|
defaultnoexcept |
Construct an empty, closed scope. Status reports ESP_FAIL until opened.
Referenced by NvsScope(), NvsScope(), NvsScope(), operator=(), and operator=().
|
inlinenoexcept |
Open ns in mode. Errors are silent; use bool conversion or status() to check.
Definition at line 112 of file Raii.h.
References NvsScope().
|
delete |
References NvsScope().
|
inlinenoexcept |
Definition at line 126 of file Raii.h.
References NvsScope().
|
inlinenoexcept |
|
inlinenoexcept |
Commit pending writes. Caller checks the return value if needed.
Definition at line 153 of file Raii.h.
Referenced by cdc::mod_gpg::GpgRecvStore::deleteKey().
|
inlineexplicitnoexcept |
|
inlinenoexcept |
References NvsScope().
Definition at line 131 of file Raii.h.
References NvsScope().
|
inlinenoexcept |