`fl::string` extends `string_n ` with the composite-type formatter overloads (CRGB, vec2, span, vector, optional, …), the `substring()` / `trim()` family (returning `string` so callers chain naturally), and the static factory + comparison methods. The trampoline pattern is: fl::string -> fl::string_n -> fl::basic_string where only `basic_string` carries the real bytes
| 191 | // where only `basic_string` carries the real bytes; the upper |
| 192 | // layers are thin wrappers that get folded out by the optimizer. |
| 193 | class string : public string_n<FASTLED_STR_INLINED_SIZE> { |
| 194 | public: |
| 195 | static constexpr fl::size npos = static_cast<fl::size>(-1); |
| 196 | |
| 197 | using basic_string::copy; |
| 198 | using basic_string::assign; |
| 199 | using basic_string::append; |
| 200 | using basic_string::appendHex; |
| 201 | using basic_string::appendOct; |
| 202 | |
| 203 | // ======= STATIC FACTORY METHODS ======= |
| 204 | static string from_literal(const char* literal) FL_NOEXCEPT; |
| 205 | static string from_view(const char* data, fl::size len) FL_NOEXCEPT; |
| 206 | static string from_view(const string_view& sv) FL_NOEXCEPT; |
| 207 | static string interned(const char* str, fl::size len) FL_NOEXCEPT; |
| 208 | static string interned(const char* str) FL_NOEXCEPT; |
| 209 | static string interned(const string_view& sv) FL_NOEXCEPT; |
| 210 | static string copy_no_view(const string& str) FL_NOEXCEPT; |
| 211 | static int strcmp(const string& a, const string& b) FL_NOEXCEPT; |
| 212 | |
| 213 | // ======= CONSTRUCTORS ======= |
| 214 | // All non-template ctors delegate to string_n<N>'s ctors — |
| 215 | // defined in string.cpp.hpp as one-line forwarders for header |
| 216 | // hygiene. Template ctors stay inline (they're parameterised |
| 217 | // on caller types and can't be split out). |
| 218 | string() FL_NOEXCEPT; |
| 219 | string(const char* str) FL_NOEXCEPT; |
| 220 | string(const char* str, fl::size len) FL_NOEXCEPT; |
| 221 | string(fl::size len, char c) FL_NOEXCEPT; |
| 222 | string(const string& other) FL_NOEXCEPT; |
| 223 | string(string&& other) FL_NOEXCEPT; |
| 224 | string(const basic_string& other) FL_NOEXCEPT; |
| 225 | string(const string_view& sv) FL_NOEXCEPT; |
| 226 | string(const fl::span<const char>& s) FL_NOEXCEPT; |
| 227 | string(const fl::span<char>& s) FL_NOEXCEPT; |
| 228 | string(const fl::shared_ptr<StringHolder>& holder) FL_NOEXCEPT; |
| 229 | template <typename InputIt> |
| 230 | string(InputIt first, InputIt last) FL_NOEXCEPT |
| 231 | : string_n<FASTLED_STR_INLINED_SIZE>(first, last) {} |
| 232 | template <int N> |
| 233 | string(const char (&str)[N]) FL_NOEXCEPT |
| 234 | : string_n<FASTLED_STR_INLINED_SIZE>(str) {} |
| 235 | |
| 236 | // ======= ASSIGNMENT ======= |
| 237 | string& operator=(const string& other) FL_NOEXCEPT; |
| 238 | string& operator=(string&& other) FL_NOEXCEPT; |
| 239 | string& operator=(const char* str) FL_NOEXCEPT; |
| 240 | template <int N> string& operator=(const char (&str)[N]) FL_NOEXCEPT { |
| 241 | assign(str, N - 1); |
| 242 | return *this; |
| 243 | } |
| 244 | |
| 245 | string& assign(string_view sv) FL_NOEXCEPT; |
| 246 | |
| 247 | // ======= SUBSTRING (returns string, so must live here) ======= |
| 248 | string substring(fl::size start, fl::size end) const FL_NOEXCEPT; |
| 249 | string substr(fl::size start, fl::size length) const FL_NOEXCEPT; |
| 250 | string substr(fl::size start) const FL_NOEXCEPT; |
no test coverage detected