FastLED 3.10.6
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.

467 {
468 if (count == 0) {
469 clear();
470 return *this;
471 }
472 mLength = count;
473 if (count + 1 <= mInlineCapacity) {
474 if (!isInline()) {
475 mStorage.reset();
476 }
477 for (fl::size i = 0; i < count; ++i) {
478 inlineBufferPtr()[i] = c;
479 }
480 inlineBufferPtr()[count] = '\0';
481 } else {
484 for (fl::size i = 0; i < count; ++i) {
485 ptr->data()[i] = c;
486 }
487 ptr->data()[count] = '\0';
488 }
489 return *this;
490}
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
fl::not_null< StringHolderPtr > NotNullStringHolderPtr
void clear(CRGB(&arr)[N])
Definition clear.h:12
shared_ptr< T > make_shared(Args &&... args) FL_NO_EXCEPT
Definition shared_ptr.h:414