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

◆ copy() [2/3]

template<fl::size SIZE = FASTLED_STR_INLINED_SIZE>
void fl::StrN< SIZE >::copy ( const char * str,
fl::size len )
inline

Definition at line 218 of file str.h.

218 {
219 mLength = len;
220 if (len + 1 <= SIZE) {
221 fl::memcopy(mInlineData, str, len); // Copy only len characters, not len+1
222 mInlineData[len] = '\0'; // Add null terminator manually
223 mHeapData.reset();
224 } else {
226 }
227 }
StringHolderPtr mHeapData
Definition str.h:142
char mInlineData[SIZE]
Definition str.h:141
fl::size mLength
Definition str.h:140
void * memcopy(void *dst, const void *src, fl::size num)
Definition memfill.h:30
shared_ptr< T > make_shared(Args &&... args)
Definition shared_ptr.h:348

References fl::make_shared(), fl::memcopy(), mHeapData, mInlineData, and mLength.

+ Here is the call graph for this function: