35 static constexpr fl::size
npos =
static_cast<fl::size
>(-1);
117 const char* tmp_data =
mData;
118 fl::size tmp_size =
mSize;
121 other.mData = tmp_data;
122 other.mSize = tmp_size;
131 fl::size actual_count = count;
135 if (actual_count > 0) {
146 fl::size actual_count = count;
147 if (actual_count ==
npos ||
pos + actual_count >
mSize) {
155 fl::size min_len = (
mSize < other.mSize) ?
mSize : other.mSize;
156 for (fl::size i = 0; i < min_len; ++i) {
157 if (
mData[i] < other.mData[i])
return -1;
158 if (
mData[i] > other.mData[i])
return 1;
160 if (
mSize < other.mSize)
return -1;
161 if (
mSize > other.mSize)
return 1;
170 fl::size pos2, fl::size count2)
const FL_NOEXCEPT {
171 return substr(pos1, count1).
compare(other.substr(pos2, count2));
190 for (fl::size i =
pos; i <
mSize; ++i) {
191 if (
mData[i] == ch) {
205 for (fl::size j = 0; j < sv.
mSize; ++j) {
228 for (fl::size i = search_pos + 1; i > 0; --i) {
229 if (
mData[i - 1] == ch) {
240 fl::size max_start =
mSize - sv.mSize;
242 if (search_start + sv.mSize >
mSize) {
243 search_start = max_start;
246 for (fl::size i = search_start + 1; i > 0; --i) {
247 fl::size idx = i - 1;
248 if (idx + sv.mSize >
mSize)
continue;
250 for (fl::size j = 0; j < sv.mSize; ++j) {
251 if (
mData[idx + j] != sv.mData[j]) {
256 if (match)
return idx;
272 for (fl::size i =
pos; i <
mSize; ++i) {
273 for (fl::size j = 0; j < sv.
mSize; ++j) {
296 if (
mSize == 0 || sv.empty())
return npos;
298 for (fl::size i = search_pos + 1; i > 0; --i) {
299 for (fl::size j = 0; j < sv.mSize; ++j) {
300 if (
mData[i - 1] == sv.mData[j]) {
323 for (fl::size i =
pos; i <
mSize; ++i) {
325 for (fl::size j = 0; j < sv.
mSize; ++j) {
331 if (!found)
return i;
338 for (fl::size i =
pos; i <
mSize; ++i) {
339 if (
mData[i] != ch)
return i;
356 for (fl::size i = search_pos + 1; i > 0; --i) {
358 for (fl::size j = 0; j < sv.mSize; ++j) {
359 if (
mData[i - 1] == sv.mData[j]) {
364 if (!found)
return i - 1;
372 for (fl::size i = search_pos + 1; i > 0; --i) {
373 if (
mData[i - 1] != ch)
return i - 1;
388 if (sv.mSize >
mSize)
return false;
389 for (fl::size i = 0; i < sv.mSize; ++i) {
390 if (
mData[i] != sv.mData[i])
return false;
404 if (sv.mSize >
mSize)
return false;
405 for (fl::size i = 0; i < sv.mSize; ++i) {
406 if (
mData[
mSize - sv.mSize + i] != sv.mData[i])
return false;
438 return lhs.compare(rhs) == 0;
442 return lhs.compare(rhs) != 0;
446 return lhs.compare(rhs) < 0;
450 return lhs.compare(rhs) <= 0;
454 return lhs.compare(rhs) > 0;
458 return lhs.compare(rhs) >= 0;
465 u32 hash = 2166136261u;
466 for (fl::size i = 0; i < sv.size(); ++i) {
467 hash ^=
static_cast<u32
>(sv[i]);
Concrete type-erased string class.
constexpr bool empty() const FL_NOEXCEPT
constexpr string_view(const char *str, fl::size len) FL_NOEXCEPT
bool starts_with(char ch) const FL_NOEXCEPT
fl::size find_first_not_of(string_view sv, fl::size pos=0) const FL_NOEXCEPT
constexpr iterator end() const FL_NOEXCEPT
int compare(fl::size pos1, fl::size count1, string_view other, fl::size pos2, fl::size count2) const FL_NOEXCEPT
int compare(fl::size pos1, fl::size count1, const char *s, fl::size count2) const FL_NOEXCEPT
bool contains(const char *s) const FL_NOEXCEPT
fl::size find_first_not_of(const char *s, fl::size pos=0) const FL_NOEXCEPT
fl::size find_last_of(char ch, fl::size pos=npos) const FL_NOEXCEPT
constexpr reverse_iterator rend() const FL_NOEXCEPT
fl::size find_first_of(char ch, fl::size pos=0) const FL_NOEXCEPT
int compare(fl::size pos1, fl::size count1, string_view other) const FL_NOEXCEPT
static constexpr fl::size npos
bool contains(char ch) const FL_NOEXCEPT
constexpr const_reverse_iterator crbegin() const FL_NOEXCEPT
fl::size find_first_of(const char *s, fl::size pos, fl::size count) const FL_NOEXCEPT
bool ends_with(string_view sv) const FL_NOEXCEPT
constexpr string_view(const char *str) FL_NOEXCEPT
constexpr iterator begin() const FL_NOEXCEPT
fl::size rfind(const char *s, fl::size pos, fl::size count) const FL_NOEXCEPT
fl::size find_last_not_of(const char *s, fl::size pos, fl::size count) const FL_NOEXCEPT
void remove_suffix(fl::size n) FL_NOEXCEPT
bool starts_with(const char *s) const FL_NOEXCEPT
constexpr const_iterator cend() const FL_NOEXCEPT
constexpr fl::size max_size() const FL_NOEXCEPT
int compare(string_view other) const FL_NOEXCEPT
const char * const_iterator
const char & const_reference
fl::size find_first_not_of(char ch, fl::size pos=0) const FL_NOEXCEPT
constexpr fl::size size() const FL_NOEXCEPT
constexpr const char & front() const FL_NOEXCEPT
constexpr const_reverse_iterator crend() const FL_NOEXCEPT
const char * const_reverse_iterator
fl::size find_first_not_of(const char *s, fl::size pos, fl::size count) const FL_NOEXCEPT
constexpr string_view(const char(&arr)[N]) FL_NOEXCEPT
fl::size rfind(string_view sv, fl::size pos=npos) const FL_NOEXCEPT
const char * reverse_iterator
fl::size find(char ch, fl::size pos=0) const FL_NOEXCEPT
fl::size find(const char *s, fl::size pos=0) const FL_NOEXCEPT
bool ends_with(char ch) const FL_NOEXCEPT
string_view(const string_view &other) FL_NOEXCEPT=default
constexpr const char & operator[](fl::size index) const FL_NOEXCEPT
fl::size find_last_not_of(const char *s, fl::size pos=npos) const FL_NOEXCEPT
fl::size find(string_view sv, fl::size pos=0) const FL_NOEXCEPT
string_view & operator=(const string_view &other)=default
fl::size copy(char *dest, fl::size count, fl::size pos=0) const FL_NOEXCEPT
fl::size rfind(char ch, fl::size pos=npos) const FL_NOEXCEPT
int compare(fl::size pos1, fl::size count1, const char *s) const FL_NOEXCEPT
bool ends_with(const char *s) const FL_NOEXCEPT
fl::size find(const char *s, fl::size pos, fl::size count) const FL_NOEXCEPT
constexpr fl::size length() const FL_NOEXCEPT
fl::size rfind(const char *s, fl::size pos=npos) const FL_NOEXCEPT
fl::size find_last_of(string_view sv, fl::size pos=npos) const FL_NOEXCEPT
fl::size find_last_not_of(char ch, fl::size pos=npos) const FL_NOEXCEPT
constexpr reverse_iterator rbegin() const FL_NOEXCEPT
constexpr const_iterator cbegin() const FL_NOEXCEPT
constexpr const char * data() const FL_NOEXCEPT
bool contains(string_view sv) const FL_NOEXCEPT
bool starts_with(string_view sv) const FL_NOEXCEPT
constexpr const char & back() const FL_NOEXCEPT
const char * const_pointer
fl::size find_first_of(string_view sv, fl::size pos=0) const FL_NOEXCEPT
void swap(string_view &other) FL_NOEXCEPT
fl::size find_last_of(const char *s, fl::size pos, fl::size count) const FL_NOEXCEPT
string_view substr(fl::size pos=0, fl::size count=npos) const FL_NOEXCEPT
fl::size find_last_not_of(string_view sv, fl::size pos=npos) const FL_NOEXCEPT
int compare(const char *s) const FL_NOEXCEPT
fl::size find_last_of(const char *s, fl::size pos=npos) const FL_NOEXCEPT
constexpr const char & at(fl::size index) const FL_NOEXCEPT
fl::size find_first_of(const char *s, fl::size pos=0) const FL_NOEXCEPT
void remove_prefix(fl::size n) FL_NOEXCEPT
constexpr string_view() FL_NOEXCEPT
void * memcpy(void *dest, const void *src, size_t n) FL_NOEXCEPT
size_t strlen(const char *s) FL_NOEXCEPT
FASTLED_FORCE_INLINE bool operator!=(const CRGB &lhs, const CRGB &rhs) FL_NOEXCEPT
Check if two CRGB objects do not have the same color data.
FASTLED_FORCE_INLINE bool operator<(const CRGB &lhs, const CRGB &rhs) FL_NOEXCEPT
Check if the sum of the color channels in one CRGB object is less than another.
FASTLED_FORCE_INLINE bool operator==(const CRGB &lhs, const CRGB &rhs) FL_NOEXCEPT
Check if two CRGB objects have the same color data.
FASTLED_FORCE_INLINE bool operator>(const CRGB &lhs, const CRGB &rhs) FL_NOEXCEPT
Check if the sum of the color channels in one CRGB object is greater than another.
FASTLED_FORCE_INLINE bool operator<=(const CRGB &lhs, const CRGB &rhs) FL_NOEXCEPT
Check if the sum of the color channels in one CRGB object is less than or equal to another.
u32 hash_string_view(string_view sv) FL_NOEXCEPT
FASTLED_FORCE_INLINE bool operator>=(const CRGB &lhs, const CRGB &rhs) FL_NOEXCEPT
Check if the sum of the color channels in one CRGB object is greater than or equal to another.
Base definition for an LED controller.