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

◆ copy() [3/4]

void fl::basic_string::copy ( const char * str)

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

382 {
383 fl::size len = fl::strlen(str);
384 mLength = len;
385 if (len + 1 <= mInlineCapacity) {
386 if (!isInline()) {
387 mStorage.reset();
388 }
389 fl::memcpy(inlineBufferPtr(), str, len + 1);
390 } else {
391 if (hasHeapData() && heapData().get().use_count() <= 1) {
392 heapData()->copy(str, len);
393 return;
394 }
396 }
397}
NotNullStringHolderPtr & heapData() FL_NO_EXCEPT
bool hasHeapData() const 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
FASTLED_FORCE_INLINE void * memcpy(void *dest, const void *src, size_t n) FL_NO_EXCEPT
Definition cstring.h:136
pair_element< I, T1, T2 >::type & get(pair< T1, T2 > &p) FL_NO_EXCEPT
Definition pair.h:119
FASTLED_FORCE_INLINE size_t strlen(const char *s) FL_NO_EXCEPT
Definition cstring.h:56

References fl::FL_NO_EXCEPT, and fl::basic_string::write().

Referenced by assign(), operator=(), operator=(), and substring().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: