|
ESPHome 2026.8.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 192 of file wifi_component.h.
|
inline |
Definition at line 197 of file wifi_component.h.
| esphome::wifi::CompactString::CompactString | ( | const char * | str, |
| size_t | len ) |
Definition at line 57 of file wifi_component.cpp.
| esphome::wifi::CompactString::CompactString | ( | const CompactString & | other | ) |
Definition at line 80 of file wifi_component.cpp.
|
noexcept |
Definition at line 90 of file wifi_component.cpp.
| esphome::wifi::CompactString::~CompactString | ( | ) |
Definition at line 106 of file wifi_component.cpp.
|
inline |
Definition at line 206 of file wifi_component.h.
|
inline |
Definition at line 205 of file wifi_component.h.
|
inline |
Definition at line 208 of file wifi_component.h.
|
inlineprotected |
Definition at line 221 of file wifi_component.h.
|
inline |
Definition at line 218 of file wifi_component.h.
|
inline |
Definition at line 214 of file wifi_component.h.
|
inline |
Definition at line 216 of file wifi_component.h.
|
noexcept |
Definition at line 98 of file wifi_component.cpp.
| CompactString & esphome::wifi::CompactString::operator= | ( | const CompactString & | other | ) |
Definition at line 82 of file wifi_component.cpp.
|
inline |
Definition at line 217 of file wifi_component.h.
| bool esphome::wifi::CompactString::operator== | ( | const CompactString & | other | ) | const |
Definition at line 112 of file wifi_component.cpp.
| bool esphome::wifi::CompactString::operator== | ( | const StringRef & | other | ) | const |
Definition at line 115 of file wifi_component.cpp.
|
inline |
Return a StringRef view of this string (zero-copy)
Definition at line 211 of file wifi_component.h.
|
inlineprotected |
Definition at line 226 of file wifi_component.h.
|
inline |
Definition at line 207 of file wifi_component.h.
|
staticconstexpr |
Definition at line 195 of file wifi_component.h.
|
protected |
Definition at line 232 of file wifi_component.h.
|
protected |
Definition at line 231 of file wifi_component.h.
|
staticconstexpr |
Definition at line 194 of file wifi_component.h.
|
protected |
Definition at line 230 of file wifi_component.h.