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

◆ copy() [1/3]

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

Definition at line 164 of file str.h.

164 {
166 mLength = len;
167 if (len + 1 <= SIZE) {
168 memcpy(mInlineData, str, len + 1);
169 mHeapData.reset();
170 } else {
171 if (mHeapData && mHeapData.use_count() <= 1) {
172 // We are the sole owners of this data so we can modify it
173 mHeapData->copy(str, len);
174 return;
175 }
176 mHeapData.reset();
178 }
179 }
StringHolderPtr mHeapData
Definition str.h:142
char mInlineData[SIZE]
Definition str.h:141
fl::size mLength
Definition str.h:140
shared_ptr< T > make_shared(Args &&... args)
Definition shared_ptr.h:348

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

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

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