FastLED 3.9.15
Loading...
Searching...
No Matches

◆ assign() [5/6]

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

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

443 {
444 if (count == 0) {
445 clear();
446 return *this;
447 }
448 mLength = count;
449 if (count + 1 <= mInlineCapacity) {
450 if (!isInline()) {
451 mStorage.reset();
452 }
453 for (fl::size i = 0; i < count; ++i) {
454 inlineBufferPtr()[i] = c;
455 }
456 inlineBufferPtr()[count] = '\0';
457 } else {
460 for (fl::size i = 0; i < count; ++i) {
461 ptr->data()[i] = c;
462 }
463 ptr->data()[count] = '\0';
464 }
465 return *this;
466}
bool isInline() const FL_NOEXCEPT
fl::size mInlineCapacity
void clear(bool freeMemory=false) FL_NOEXCEPT
NotNullStringHolderPtr & heapData() FL_NOEXCEPT
fl::variant< NotNullStringHolderPtr, ConstLiteral, ConstView > mStorage
char * inlineBufferPtr() FL_NOEXCEPT
fl::not_null< StringHolderPtr > NotNullStringHolderPtr
shared_ptr< T > make_shared(Args &&... args) FL_NOEXCEPT
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: