29 class __FlashStringHelper;
45 static DEFINE_FSTR_DATA(__fstr__, str); \ 46 static_cast<const FSTR::String*>(&__fstr__.object); \ 56 #define FS(str) (*FS_PTR(str)) 63 #define DECLARE_FSTR(name) DECLARE_FSTR_OBJECT(name, FSTR::String) 77 #define DEFINE_FSTR(name, str) \ 78 static DEFINE_FSTR_DATA(FSTR_DATA_NAME(name), str); \ 79 DEFINE_FSTR_REF_NAMED(name, FSTR::String); 84 #define DEFINE_FSTR_LOCAL(name, str) \ 85 static DEFINE_FSTR_DATA(FSTR_DATA_NAME(name), str); \ 86 static constexpr DEFINE_FSTR_REF_NAMED(name, FSTR::String); 93 #define DEFINE_FSTR_DATA(name, str) \ 94 constexpr const struct { \ 95 FSTR::ObjectBase object; \ 96 char data[ALIGNUP4(sizeof(str))]; \ 97 } name PROGMEM = {{sizeof(str) - 1}, str}; \ 98 FSTR_CHECK_STRUCT(name); 111 #define LOAD_FSTR(name, fstr) \ 112 char name[(fstr).size()] FSTR_ALIGNED; \ 113 memcpy_aligned(name, (fstr).data(), (fstr).length()); \ 114 name[(fstr).length()] = '\0'; 123 #define FSTR_ARRAY(name, str) \ 124 static DEFINE_FSTR_DATA(FSTR_DATA_NAME(name), str); \ 125 LOAD_FSTR(name, FSTR_DATA_NAME(name).object.template as<FSTR::String>()) 133 #define IMPORT_FSTR(name, file) IMPORT_FSTR_OBJECT(name, FSTR::String, file) 138 #define IMPORT_FSTR_LOCAL(name, file) IMPORT_FSTR_OBJECT_LOCAL(name, FSTR::String, file) 161 #define FSTR_TABLE(name) const FSTR::String* const name[] PROGMEM 200 bool equals(
const char* cstr,
size_t len = 0)
const;
232 bool equals(
const WString& str)
const;
const __FlashStringHelper * flash_string_t
Definition: String.hpp:29
bool operator!=(const char *str) const
Definition: String.hpp:218
#define str(s)
Definition: testrunner.h:124
const __FlashStringHelper * flash_string_t
Provides a strongly-typed pointer to allow safe implicit operation using String class methods...
Definition: WString.h:91
flash_string_t data() const
Get a WString-compatible pointer to the flash data.
Definition: String.hpp:188
size_t length() const
Get the length of the content in elements.
Definition: Object.hpp:164
The String class.
Definition: WString.h:136
::String WString
A Wiring String.
Definition: String.hpp:168
size_t printTo(Print &p) const
Definition: String.hpp:262
bool equalsIgnoreCase(const WString &str) const
Provides formatted output to stream.
Definition: Print.h:36
bool operator==(const WString &str) const
Definition: String.hpp:236
Wrapper class to efficiently print large Strings.
Definition: StringPrinter.hpp:34
size_t printTo(Print &p) const override
Base class template for all types.
Definition: Object.hpp:120
bool operator==(const String &str) const
Definition: String.hpp:213
bool equals(const char *cstr, size_t len=0) const
Check for equality with a C-string.
bool operator!=(const String &str) const
Definition: String.hpp:223
describes a counted string stored in flash memory
Definition: String.hpp:173
size_t size() const
Get the number of bytes used to store the String.
Definition: String.hpp:180
StringPrinter printer() const
Supports printing of large String objects.
Definition: String.hpp:257
bool operator==(const char *str) const
Definition: String.hpp:208
Definition: Array.hpp:107
bool operator!=(const WString &str) const
Definition: String.hpp:241
#define ALIGNUP4(n)
Align a size up to the nearest word boundary.
Definition: FakePgmSpace.h:48
const ElementType * data() const
Definition: Object.hpp:203