|
ESPHome 2026.3.0-dev
|
20-byte string: 18 chars inline + null, heap for longer. More...
#include <wifi_component.h>
Public Member Functions | |
| CompactString () | |
| CompactString (const char *str, size_t len) | |
| CompactString (const CompactString &other) | |
| CompactString (CompactString &&other) noexcept | |
| CompactString & | operator= (const CompactString &other) |
| CompactString & | operator= (CompactString &&other) noexcept |
| ~CompactString () | |
| const char * | data () const |
| const char * | c_str () const |
| size_t | size () const |
| bool | empty () const |
| StringRef | ref () const |
| Return a StringRef view of this string (zero-copy) | |
| bool | operator== (const CompactString &other) const |
| bool | operator!= (const CompactString &other) const |
| bool | operator== (const StringRef &other) const |
| bool | operator!= (const StringRef &other) const |
| bool | operator== (const char *other) const |
| bool | operator!= (const char *other) const |
Static Public Attributes | |
| static constexpr uint8_t | MAX_LENGTH = 127 |
| static constexpr uint8_t | INLINE_CAPACITY = 18 |
Protected Member Functions | |
| char * | get_heap_ptr_ () const |
| void | set_heap_ptr_ (char *ptr) |
Protected Attributes | |
| char | storage_ [INLINE_CAPACITY+1] |
| uint8_t | length_: 7 |
| uint8_t | is_heap_: 1 |
20-byte string: 18 chars inline + null, heap for longer.
Always null-terminated. Used internally for WiFi SSID/password storage to reduce heap fragmentation.
Definition at line 177 of file wifi_component.h.
|
inline |
Definition at line 182 of file wifi_component.h.
| esphome::wifi::CompactString::CompactString | ( | const char * | str, |
| size_t | len ) |
Definition at line 52 of file wifi_component.cpp.
| esphome::wifi::CompactString::CompactString | ( | const CompactString & | other | ) |
Definition at line 75 of file wifi_component.cpp.
|
noexcept |
Definition at line 85 of file wifi_component.cpp.
| esphome::wifi::CompactString::~CompactString | ( | ) |
Definition at line 101 of file wifi_component.cpp.
|
inline |
Definition at line 191 of file wifi_component.h.
|
inline |
Definition at line 190 of file wifi_component.h.
|
inline |
Definition at line 193 of file wifi_component.h.
|
inlineprotected |
Definition at line 206 of file wifi_component.h.
|
inline |
Definition at line 203 of file wifi_component.h.
|
inline |
Definition at line 199 of file wifi_component.h.
|
inline |
Definition at line 201 of file wifi_component.h.
|
noexcept |
Definition at line 93 of file wifi_component.cpp.
| CompactString & esphome::wifi::CompactString::operator= | ( | const CompactString & | other | ) |
Definition at line 77 of file wifi_component.cpp.
|
inline |
Definition at line 202 of file wifi_component.h.
| bool esphome::wifi::CompactString::operator== | ( | const CompactString & | other | ) | const |
Definition at line 107 of file wifi_component.cpp.
| bool esphome::wifi::CompactString::operator== | ( | const StringRef & | other | ) | const |
Definition at line 110 of file wifi_component.cpp.
|
inline |
Return a StringRef view of this string (zero-copy)
Definition at line 196 of file wifi_component.h.
|
inlineprotected |
Definition at line 211 of file wifi_component.h.
|
inline |
Definition at line 192 of file wifi_component.h.
|
staticconstexpr |
Definition at line 180 of file wifi_component.h.
|
protected |
Definition at line 217 of file wifi_component.h.
|
protected |
Definition at line 216 of file wifi_component.h.
|
staticconstexpr |
Definition at line 179 of file wifi_component.h.
|
protected |
Definition at line 215 of file wifi_component.h.