FastLED 3.10.6
Loading...
Searching...
No Matches

◆ assign() [5/6]

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

Definition at line 467 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}
void clear(bool freeMemory=false) FL_NO_EXCEPT
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
shared_ptr< T > make_shared(Args &&... args) FL_NO_EXCEPT
Definition shared_ptr.h:414

References basic_string(), clear(), heapData(), inlineBufferPtr(), isInline(), fl::make_shared(), mInlineCapacity, mLength, and mStorage.

+ Here is the call graph for this function: