FastLED 3.10.6
Loading...
Searching...
No Matches

◆ materialize()

void fl::basic_string::materialize ( )
protected

Definition at line 164 of file basic_string.cpp.hpp.

164 {
165 if (mStorage.is<ConstLiteral>()) {
166 const char* data = mStorage.get<ConstLiteral>().data;
167 if (!data) {
168 mLength = 0;
169 mStorage.reset();
170 inlineBufferPtr()[0] = '\0';
171 return;
172 }
173 fl::size len = mLength;
174 if (len + 1 <= mInlineCapacity) {
176 inlineBufferPtr()[len] = '\0';
177 mStorage.reset();
178 } else {
180 }
181 } else if (mStorage.is<ConstView>()) {
182 const ConstView& view = mStorage.get<ConstView>();
183 if (!view.data) {
184 mLength = 0;
185 mStorage.reset();
186 inlineBufferPtr()[0] = '\0';
187 return;
188 }
189 fl::size len = view.length;
190 mLength = len;
191 if (len + 1 <= mInlineCapacity) {
192 fl::memcpy(inlineBufferPtr(), view.data, len);
193 inlineBufferPtr()[len] = '\0';
194 mStorage.reset();
195 } else {
197 }
198 }
199}
fl::size mInlineCapacity
char * inlineBufferPtr() FL_NO_EXCEPT
fl::variant< NotNullStringHolderPtr, ConstLiteral, ConstView > mStorage
const char * data() const FL_NO_EXCEPT
fl::not_null< StringHolderPtr > NotNullStringHolderPtr
void * memcpy(void *dest, const void *src, size_t n) FL_NO_EXCEPT
shared_ptr< T > make_shared(Args &&... args) FL_NO_EXCEPT
Definition shared_ptr.h:414

References fl::basic_string::ConstView::data, data(), inlineBufferPtr(), fl::basic_string::ConstView::length, fl::make_shared(), fl::memcpy(), mInlineCapacity, mLength, and mStorage.

Referenced by c_str(), c_str_mutable(), insert(), insert(), replace(), and replace().

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