|
ESPHome 2026.7.4
|
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 199 of file wifi_component.h.
|
inline |
Definition at line 204 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 213 of file wifi_component.h.
|
inline |
Definition at line 212 of file wifi_component.h.
|
inline |
Definition at line 215 of file wifi_component.h.
|
inlineprotected |
Definition at line 228 of file wifi_component.h.
|
inline |
Definition at line 225 of file wifi_component.h.
|
inline |
Definition at line 221 of file wifi_component.h.
|
inline |
Definition at line 223 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 224 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 218 of file wifi_component.h.
|
inlineprotected |
Definition at line 233 of file wifi_component.h.
|
inline |
Definition at line 214 of file wifi_component.h.
|
staticconstexpr |
Definition at line 202 of file wifi_component.h.
|
protected |
Definition at line 239 of file wifi_component.h.
|
protected |
Definition at line 238 of file wifi_component.h.
|
staticconstexpr |
Definition at line 201 of file wifi_component.h.
|
protected |
Definition at line 237 of file wifi_component.h.