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

◆ assign() [5/6]

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

Definition at line 481 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}
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
shared_ptr< T > make_shared(Args &&... args) FL_NO_EXCEPT
Definition shared_ptr.h:423
fl::not_null< StringHolderPtr > NotNullStringHolderPtr

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

+ Here is the call graph for this function: