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

102 {
103 size_t len = strlen(str);
104 mLength = len;
105 if (len + 1 <= SIZE) {
106 memcpy(mInlineData, str, len + 1);
107 mHeapData.reset();
108 } else {
109 if (mHeapData && !mHeapData->isShared()) {
110 // We are the sole owners of this data so we can modify it
111 mHeapData->copy(str, len);
112 return;
113 }
114 mHeapData.reset();
116 }
117 }
size_t mLength
Definition str.h:81
StringHolderPtr mHeapData
Definition str.h:83
char mInlineData[SIZE]
Definition str.h:82
Definition str.h:79

References mHeapData, mInlineData, and mLength.

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

+ Here is the caller graph for this function: