ESPHome 2026.3.0-dev
Loading...
Searching...
No Matches
esphome::ProgmemStringTable< Strs > Struct Template Reference

Compile-time string table that packs strings into a single blob with offset lookup. More...

#include <progmem.h>

Static Public Member Functions

static constexpr auto make_blob ()
 Generate packed string blob at compile time.
 
static constexpr auto make_offsets ()
 Generate offset table at compile time (uint8_t limits blob to 255 bytes)
 

Static Public Attributes

static constexpr size_t COUNT = sizeof...(Strs)
 
static constexpr size_t BLOB_SIZE = (0 + ... + (Strs.size() + 1))
 

Detailed Description

template<FixedString... Strs>
struct esphome::ProgmemStringTable< Strs >

Compile-time string table that packs strings into a single blob with offset lookup.

Use PROGMEM_STRING_TABLE macro to instantiate with proper flash placement on ESP8266.

Example: PROGMEM_STRING_TABLE(MyStrings, "foo", "bar", "baz"); ProgmemStr str = MyStrings::get_progmem_str(idx, MyStrings::LAST_INDEX); // For ArduinoJson const LogString *log_str = MyStrings::get_log_str(idx, MyStrings::LAST_INDEX); // For logging

Definition at line 62 of file progmem.h.

Member Function Documentation

◆ make_blob()

template<FixedString... Strs>
static constexpr auto esphome::ProgmemStringTable< Strs >::make_blob ( )
inlinestaticconstexpr

Generate packed string blob at compile time.

Definition at line 67 of file progmem.h.

◆ make_offsets()

template<FixedString... Strs>
static constexpr auto esphome::ProgmemStringTable< Strs >::make_offsets ( )
inlinestaticconstexpr

Generate offset table at compile time (uint8_t limits blob to 255 bytes)

Definition at line 79 of file progmem.h.

Field Documentation

◆ BLOB_SIZE

template<FixedString... Strs>
size_t esphome::ProgmemStringTable< Strs >::BLOB_SIZE = (0 + ... + (Strs.size() + 1))
staticconstexpr

Definition at line 64 of file progmem.h.

◆ COUNT

template<FixedString... Strs>
size_t esphome::ProgmemStringTable< Strs >::COUNT = sizeof...(Strs)
staticconstexpr

Definition at line 63 of file progmem.h.


The documentation for this struct was generated from the following file: