1031 {
1033
1034
1037 }
1038
1039 fl::size actualCount = count;
1042 }
1043 fl::size newLen =
mLength - actualCount + count2;
1044
1045
1050 for (fl::size i = 0; i < count2; ++i) newData->data()[
pos + i] = ch;
1051 fl::size remainingLen =
mLength -
pos - actualCount;
1052 if (remainingLen > 0) {
1053 fl::memcpy(newData->data() +
pos + count2, heap->data() +
pos + actualCount, remainingLen);
1054 }
1055 newData->data()[newLen] = '\0';
1058 return *this;
1059 }
1060
1061
1063 if (count2 != actualCount) {
1064 fl::size remainingLen =
mLength -
pos - actualCount;
1065 if (remainingLen > 0) {
1067 }
1068 }
1072 return *this;
1073 }
1074
1075
1077 if (canReplaceInPlace) {
1079 canReplaceInPlace = heap.get().use_count() <= 1 && heap->hasCapacity(newLen);
1080 if (canReplaceInPlace) {
1081 char*
data = heap->data();
1082 if (count2 != actualCount) {
1083 fl::size remainingLen =
mLength -
pos - actualCount;
1084 if (remainingLen > 0) {
1086 }
1087 }
1088 for (fl::size i = 0; i < count2; ++i)
data[
pos + i] = ch;
1091 }
1092 }
1093 if (!canReplaceInPlace) {
1095 const char* src =
c_str();
1097 for (fl::size i = 0; i < count2; ++i) newData->data()[
pos + i] = ch;
1098 fl::size remainingLen =
mLength -
pos - actualCount;
1099 if (remainingLen > 0) {
1100 fl::memcpy(newData->data() +
pos + count2, src +
pos + actualCount, remainingLen);
1101 }
1102 newData->data()[newLen] = '\0';
1105 }
1106 return *this;
1107}
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