229 {
231
232
235 fl::size existingLen =
mLength;
237 if (existingLen > 0 && existingData) {
239 }
244 } else {
246 if (!newData->hasCapacity(newLen)) {
248 }
249 if (existingLen > 0 && existingData) {
250 fl::memcpy(newData->data(), existingData, existingLen);
251 }
252 fl::memcpy(newData->data() + existingLen, str, n);
253 newData->data()[newLen] = '\0';
256 }
258 }
259
262 if (!heap->hasCapacity(newLen)) {
263
264
265 const char* bufStart = heap->data();
266 fl::size grow_length =
fl::max(3, newLen * 3 / 2);
267 if (str >= bufStart && str < bufStart +
mLength + 1) {
268 fl::size
offset =
static_cast<fl::size
>(str - bufStart);
269 heap->grow(grow_length);
270 str = heap->data() +
offset;
271 } else {
272 heap->grow(grow_length);
273 }
274
275
276 if (!heap->hasCapacity(newLen)) {
278 }
279 }
285
287 if (!newData->hasCapacity(newLen)) {
289 }
290 {
294 newData->data()[newLen] = '\0';
297 }
299 }
308 }
309
311 if (!newData->hasCapacity(newLen)) {
313 }
314 {
317 newData->data()[newLen] = '\0';
320 }
322}
const char * constData() const FL_NO_EXCEPT
bool isNonOwning() const FL_NO_EXCEPT
NotNullStringHolderPtr & heapData() FL_NO_EXCEPT
bool hasHeapData() const FL_NO_EXCEPT
char * inlineBufferPtr() FL_NO_EXCEPT
fl::variant< NotNullStringHolderPtr, ConstLiteral, ConstView > mStorage
fl::UISlider offset("Offset", 0.0f, 0.0f, 1.0f, 0.01f)
shared_ptr< T > make_shared(Args &&... args) FL_NO_EXCEPT
constexpr common_type_t< T, U > max(T a, U b) FL_NO_EXCEPT
fl::not_null< StringHolderPtr > NotNullStringHolderPtr
FASTLED_FORCE_INLINE void * memcpy(void *dest, const void *src, size_t n) FL_NO_EXCEPT
pair_element< I, T1, T2 >::type & get(pair< T1, T2 > &p) FL_NO_EXCEPT
#define FL_DISABLE_WARNING(warning)
#define FL_DISABLE_WARNING_PUSH
#define FL_DISABLE_WARNING_POP