947 {
950
951
954 }
955
956 fl::size actualCount = count;
959 }
960 fl::size newLen =
mLength - actualCount + count2;
961
962
968 fl::size remainingLen =
mLength -
pos - actualCount;
969 if (remainingLen > 0) {
970 fl::memcpy(newData->data() +
pos + count2, heap->data() +
pos + actualCount, remainingLen);
971 }
972 newData->data()[newLen] = '\0';
975 return *this;
976 }
977
978
980 if (count2 != actualCount) {
981 fl::size remainingLen =
mLength -
pos - actualCount;
982 if (remainingLen > 0) {
984 }
985 }
989 return *this;
990 }
991
992
994 if (canReplaceInPlace) {
996 canReplaceInPlace = heap.get().use_count() <= 1 && heap->hasCapacity(newLen);
997 if (canReplaceInPlace) {
998 char*
data = heap->data();
999 if (count2 != actualCount) {
1000 fl::size remainingLen =
mLength -
pos - actualCount;
1001 if (remainingLen > 0) {
1003 }
1004 }
1008 }
1009 }
1010 if (!canReplaceInPlace) {
1012 const char* src =
c_str();
1015 fl::size remainingLen =
mLength -
pos - actualCount;
1016 if (remainingLen > 0) {
1017 fl::memcpy(newData->data() +
pos + count2, src +
pos + actualCount, remainingLen);
1018 }
1019 newData->data()[newLen] = '\0';
1022 }
1023 return *this;
1024}
basic_string & erase(fl::size pos=0, fl::size count=npos) FL_NOEXCEPT
bool isNonOwning() const FL_NOEXCEPT
bool hasHeapData() const FL_NOEXCEPT
void materialize() FL_NOEXCEPT
NotNullStringHolderPtr & heapData() FL_NOEXCEPT
static constexpr fl::size npos
const char * data() const FL_NOEXCEPT
fl::variant< NotNullStringHolderPtr, ConstLiteral, ConstView > mStorage
char * inlineBufferPtr() FL_NOEXCEPT
const char * c_str() const FL_NOEXCEPT
void * memcpy(void *dest, const void *src, size_t n) FL_NOEXCEPT
fl::not_null< StringHolderPtr > NotNullStringHolderPtr
void * memmove(void *dest, const void *src, size_t n) FL_NOEXCEPT
shared_ptr< T > make_shared(Args &&... args) FL_NOEXCEPT
pair_element< I, T1, T2 >::type & get(pair< T1, T2 > &p) FL_NOEXCEPT