971 {
974
975
978 }
979
980 fl::size actualCount = count;
983 }
984 fl::size newLen =
mLength - actualCount + count2;
985
986
992 fl::size remainingLen =
mLength -
pos - actualCount;
993 if (remainingLen > 0) {
994 fl::memcpy(newData->data() +
pos + count2, heap->data() +
pos + actualCount, remainingLen);
995 }
996 newData->data()[newLen] = '\0';
999 return *this;
1000 }
1001
1002
1004 if (count2 != actualCount) {
1005 fl::size remainingLen =
mLength -
pos - actualCount;
1006 if (remainingLen > 0) {
1008 }
1009 }
1013 return *this;
1014 }
1015
1016
1018 if (canReplaceInPlace) {
1020 canReplaceInPlace = heap.get().use_count() <= 1 && heap->hasCapacity(newLen);
1021 if (canReplaceInPlace) {
1022 char*
data = heap->data();
1023 if (count2 != actualCount) {
1024 fl::size remainingLen =
mLength -
pos - actualCount;
1025 if (remainingLen > 0) {
1027 }
1028 }
1032 }
1033 }
1034 if (!canReplaceInPlace) {
1036 const char* src =
c_str();
1039 fl::size remainingLen =
mLength -
pos - actualCount;
1040 if (remainingLen > 0) {
1041 fl::memcpy(newData->data() +
pos + count2, src +
pos + actualCount, remainingLen);
1042 }
1043 newData->data()[newLen] = '\0';
1046 }
1047 return *this;
1048}
bool isNonOwning() const FL_NO_EXCEPT
void materialize() FL_NO_EXCEPT
NotNullStringHolderPtr & heapData() FL_NO_EXCEPT
bool hasHeapData() const FL_NO_EXCEPT
static constexpr fl::size npos
char * inlineBufferPtr() FL_NO_EXCEPT
fl::variant< NotNullStringHolderPtr, ConstLiteral, ConstView > mStorage
const char * c_str() const FL_NO_EXCEPT
const char * data() const FL_NO_EXCEPT
basic_string & erase(fl::size pos=0, fl::size count=npos) FL_NO_EXCEPT
fl::not_null< StringHolderPtr > NotNullStringHolderPtr
void * memcpy(void *dest, const void *src, size_t n) FL_NO_EXCEPT
void * memmove(void *dest, const void *src, size_t n) FL_NO_EXCEPT
shared_ptr< T > make_shared(Args &&... args) FL_NO_EXCEPT
pair_element< I, T1, T2 >::type & get(pair< T1, T2 > &p) FL_NO_EXCEPT