1055 {
1057
1058
1061 }
1062
1063 fl::size actualCount = count;
1066 }
1067 fl::size newLen =
mLength - actualCount + count2;
1068
1069
1074 for (fl::size i = 0; i < count2; ++i) newData->data()[
pos + i] = ch;
1075 fl::size remainingLen =
mLength -
pos - actualCount;
1076 if (remainingLen > 0) {
1077 fl::memcpy(newData->data() +
pos + count2, heap->data() +
pos + actualCount, remainingLen);
1078 }
1079 newData->data()[newLen] = '\0';
1082 return *this;
1083 }
1084
1085
1087 if (count2 != actualCount) {
1088 fl::size remainingLen =
mLength -
pos - actualCount;
1089 if (remainingLen > 0) {
1091 }
1092 }
1096 return *this;
1097 }
1098
1099
1101 if (canReplaceInPlace) {
1103 canReplaceInPlace = heap.get().use_count() <= 1 && heap->hasCapacity(newLen);
1104 if (canReplaceInPlace) {
1105 char*
data = heap->data();
1106 if (count2 != actualCount) {
1107 fl::size remainingLen =
mLength -
pos - actualCount;
1108 if (remainingLen > 0) {
1110 }
1111 }
1112 for (fl::size i = 0; i < count2; ++i)
data[
pos + i] = ch;
1115 }
1116 }
1117 if (!canReplaceInPlace) {
1119 const char* src =
c_str();
1121 for (fl::size i = 0; i < count2; ++i) newData->data()[
pos + i] = ch;
1122 fl::size remainingLen =
mLength -
pos - actualCount;
1123 if (remainingLen > 0) {
1124 fl::memcpy(newData->data() +
pos + count2, src +
pos + actualCount, remainingLen);
1125 }
1126 newData->data()[newLen] = '\0';
1129 }
1130 return *this;
1131}
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
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