FastLED 3.10.10
Loading...
Searching...
No Matches

◆ assign() [5/7]

basic_string & fl::basic_string::assign ( fl::size count,
char c )

Definition at line 232 of file basic_string.cpp.hpp.

481 {
482 if (count == 0) {
483 clear();
484 return *this;
485 }
486 mLength = count;
487 if (count + 1 <= mInlineCapacity) {
488 if (!isInline()) {
489 mStorage.reset();
490 }
491 for (fl::size i = 0; i < count; ++i) {
492 inlineBufferPtr()[i] = c;
493 }
494 inlineBufferPtr()[count] = '\0';
495 } else {
498 for (fl::size i = 0; i < count; ++i) {
499 ptr->data()[i] = c;
500 }
501 ptr->data()[count] = '\0';
502 }
503 return *this;
504}
NotNullStringHolderPtr & heapData() FL_NO_EXCEPT
fl::size mInlineCapacity
char * inlineBufferPtr() FL_NO_EXCEPT
bool isInline() const FL_NO_EXCEPT
fl::variant< NotNullStringHolderPtr, ConstLiteral, ConstView > mStorage
shared_ptr< T > make_shared(Args &&... args) FL_NO_EXCEPT
Definition shared_ptr.h:423
fl::not_null< StringHolderPtr > NotNullStringHolderPtr
void clear(CRGB(&arr)[N]) FL_NO_EXCEPT
Definition clear.h:14