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

◆ copy() [1/3]

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

Definition at line 129 of file str.h.

129 {
130 size_t len = strlen(str);
131 mLength = len;
132 if (len + 1 <= SIZE) {
133 memcpy(mInlineData, str, len + 1);
134 mHeapData.reset();
135 } else {
136 if (mHeapData && !mHeapData->isShared()) {
137 // We are the sole owners of this data so we can modify it
138 mHeapData->copy(str, len);
139 return;
140 }
141 mHeapData.reset();
143 }
144 }
size_t mLength
Definition str.h:108
StringHolderPtr mHeapData
Definition str.h:110
char mInlineData[SIZE]
Definition str.h:109

References mHeapData, mInlineData, and mLength.

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

+ Here is the caller graph for this function: