12template <
class CharType =
char>
107 template <
typename IntType>
129 const auto rem = value % 10;
339 return !(*
this ==
rhs);
350 return *ptr < *
other;
366 return *ptr > *
other;
387 while(*
string++ !=
'\0')
413 static constexpr void
426 for(
size_t i = 0;
i < length;
i++)
442 case 'a':
return 'A';
443 case 'b':
return 'B';
444 case 'c':
return 'C';
445 case 'd':
return 'D';
446 case 'e':
return 'E';
447 case 'f':
return 'F';
448 case 'g':
return 'G';
449 case 'h':
return 'H';
450 case 'i':
return 'I';
451 case 'j':
return 'J';
452 case 'k':
return 'K';
453 case 'l':
return 'L';
454 case 'm':
return 'M';
455 case 'n':
return 'N';
456 case 'o':
return 'O';
457 case 'p':
return 'P';
458 case 'q':
return 'Q';
459 case 'r':
return 'R';
460 case 's':
return 'S';
461 case 't':
return 'T';
462 case 'u':
return 'U';
463 case 'v':
return 'V';
464 case 'w':
return 'W';
465 case 'x':
return 'X';
466 case 'y':
return 'Y';
467 case 'z':
return 'Z';
471 std::size_t
clamp(std::size_t
val, std::size_t min, std::size_t max)
473 return (
val < min) ? min : ((
val > max) ? max :
val);
488template <std::
size_t capacity,
class CharType =
char>
500 this->
size_ = std::min(
str.Size(), capacity);
504 template <
size_t otherSize>
508 this->
size_ = std::min(
str.Size(), capacity);
522 this->
size_ = std::min(length, capacity);
536template <
class CharType, std::
size_t capacity>
Definition FixedCapStr.h:14
constexpr bool StartsWithIgnoringCase(const CharType *pattern) const noexcept
Definition FixedCapStr.h:253
constexpr CharType * Data() noexcept
Definition FixedCapStr.h:42
constexpr bool operator>(const CharType *other) const
Definition FixedCapStr.h:358
constexpr bool operator==(const CharType *rhs) const
Definition FixedCapStr.h:323
constexpr void Append(const CharType *str)
Definition FixedCapStr.h:95
constexpr void AppendFloat(float value, int maxNumDigits=2, bool omitTrailingZeros=false, bool alwaysIncludeSign=false)
Definition FixedCapStr.h:137
static constexpr std::size_t strlen(const CharType *string)
Definition FixedCapStr.h:384
constexpr void RemovePrefix(std::size_t length)
Definition FixedCapStr.h:296
constexpr void Reset_(const CharType *str, std::size_t length)
Definition FixedCapStr.h:392
constexpr FixedCapStrBase(CharType *buffer, size_t capacity)
Definition FixedCapStr.h:16
constexpr void ResetAt(const CharType *str, std::size_t writePosition)
Definition FixedCapStr.h:73
constexpr void Reset(const CharType *str, std::size_t length)
Definition FixedCapStr.h:67
constexpr FixedCapStrBase(const FixedCapStrBase &other)=delete
constexpr const CharType * Data() const noexcept
Definition FixedCapStr.h:41
constexpr FixedCapStrBase & operator=(const FixedCapStrBase &str)
Definition FixedCapStr.h:23
CharType * buffer_
Definition FixedCapStr.h:478
const size_t capacity_
Definition FixedCapStr.h:477
constexpr void Append_(const CharType *str, std::size_t to_copy)
Definition FixedCapStr.h:406
constexpr auto Capacity() const noexcept
Definition FixedCapStr.h:51
constexpr bool operator<=(const CharType *other) const
Definition FixedCapStr.h:353
constexpr bool EndsWith(const CharType *pattern) const noexcept
Definition FixedCapStr.h:266
constexpr void AppendInt(IntType value, bool alwaysIncludeSign=false)
Definition FixedCapStr.h:108
static constexpr void Copy_(const CharType *src, const CharType *srcEnd, CharType *dest)
Definition FixedCapStr.h:414
constexpr auto Empty() const noexcept
Definition FixedCapStr.h:53
constexpr bool EndsWithIgnoringCase(const CharType *pattern) const noexcept
Definition FixedCapStr.h:281
constexpr void Reset(const CharType *str)
Definition FixedCapStr.h:61
constexpr auto Size() const noexcept
Definition FixedCapStr.h:44
constexpr bool operator>=(const CharType *other) const
Definition FixedCapStr.h:369
std::size_t clamp(std::size_t val, std::size_t min, std::size_t max)
Definition FixedCapStr.h:471
static constexpr void Swap_(CharType *a, CharType *b, size_t length)
Definition FixedCapStr.h:424
constexpr void RemoveSuffix(std::size_t length) noexcept
Definition FixedCapStr.h:303
constexpr void Append(const CharType singleChar)
Definition FixedCapStr.h:85
constexpr const CharType * Cstr() const noexcept
Definition FixedCapStr.h:40
constexpr void Swap(FixedCapStrBase &rhs) noexcept
Definition FixedCapStr.h:374
constexpr void Append(const CharType *str, std::size_t length)
Definition FixedCapStr.h:101
static constexpr char ToUpper_(char c) noexcept
Definition FixedCapStr.h:437
constexpr bool operator<(const CharType *other) const
Definition FixedCapStr.h:342
constexpr bool StartsWith(const CharType *pattern) const noexcept
Definition FixedCapStr.h:239
constexpr void Clear() noexcept
Definition FixedCapStr.h:55
constexpr FixedCapStrBase & operator=(const CharType *str)
Definition FixedCapStr.h:31
constexpr bool operator!=(const CharType *rhs) const
Definition FixedCapStr.h:337
constexpr void ResetAt_(const CharType *str, std::size_t strLen, std::size_t writePosition)
Definition FixedCapStr.h:399
constexpr void ReverseSection(std::size_t firstIdx, std::size_t lastIdx)
Definition FixedCapStr.h:309
constexpr auto UpdateSize() noexcept
Definition FixedCapStr.h:45
std::size_t size_
Definition FixedCapStr.h:476
Definition FixedCapStr.h:490
constexpr FixedCapStr & operator=(const FixedCapStr &str) noexcept
Definition FixedCapStr.h:526
constexpr FixedCapStr(const FixedCapStr &str) noexcept
Definition FixedCapStr.h:497
constexpr FixedCapStr(const CharType *str) noexcept
Definition FixedCapStr.h:512
constexpr FixedCapStr(const FixedCapStr< otherSize > &str) noexcept
Definition FixedCapStr.h:505
constexpr FixedCapStr(const CharType *str, std::size_t length) noexcept
Definition FixedCapStr.h:519
constexpr FixedCapStr() noexcept
Definition FixedCapStr.h:492
Definition leddriver.h:33
Hardware defines and helpers for daisy field platform.
Definition index.h:2
constexpr void Swap(const FixedCapStr< capacity, CharType > &lhs, const FixedCapStr< capacity, CharType > &rhs) noexcept
Definition FixedCapStr.h:537