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 130 of file str.h.

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

References mHeapData, mInlineData, and mLength.

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

+ Here is the caller graph for this function: