|
ESPHome 2026.4.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 185 of file wifi_component.h.
|
inline |
Definition at line 190 of file wifi_component.h.
| esphome::wifi::CompactString::CompactString | ( | const char * | str, |
| size_t | len ) |
Definition at line 53 of file wifi_component.cpp.
| esphome::wifi::CompactString::CompactString | ( | const CompactString & | other | ) |
Definition at line 76 of file wifi_component.cpp.
|
noexcept |
Definition at line 86 of file wifi_component.cpp.
| esphome::wifi::CompactString::~CompactString | ( | ) |
Definition at line 102 of file wifi_component.cpp.
|
inline |
Definition at line 199 of file wifi_component.h.
|
inline |
Definition at line 198 of file wifi_component.h.
|
inline |
Definition at line 201 of file wifi_component.h.
|
inlineprotected |
Definition at line 214 of file wifi_component.h.
|
inline |
Definition at line 211 of file wifi_component.h.
|
inline |
Definition at line 207 of file wifi_component.h.
|
inline |
Definition at line 209 of file wifi_component.h.
|
noexcept |
Definition at line 94 of file wifi_component.cpp.
| CompactString & esphome::wifi::CompactString::operator= | ( | const CompactString & | other | ) |
Definition at line 78 of file wifi_component.cpp.
|
inline |
Definition at line 210 of file wifi_component.h.
| bool esphome::wifi::CompactString::operator== | ( | const CompactString & | other | ) | const |
Definition at line 108 of file wifi_component.cpp.
| bool esphome::wifi::CompactString::operator== | ( | const StringRef & | other | ) | const |
Definition at line 111 of file wifi_component.cpp.
|
inline |
Return a StringRef view of this string (zero-copy)
Definition at line 204 of file wifi_component.h.
|
inlineprotected |
Definition at line 219 of file wifi_component.h.
|
inline |
Definition at line 200 of file wifi_component.h.
|
staticconstexpr |
Definition at line 188 of file wifi_component.h.
|
protected |
Definition at line 225 of file wifi_component.h.
|
protected |
Definition at line 224 of file wifi_component.h.
|
staticconstexpr |
Definition at line 187 of file wifi_component.h.
|
protected |
Definition at line 223 of file wifi_component.h.