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

◆ materialize()

void fl::basic_string::materialize ( )
protected

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

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