Insert text into the buffer from an array.
| 234 | |
| 235 | /// Insert text into the buffer from an array. |
| 236 | void InsertFromArray(ptrdiff_t positionToInsert, const T s[], ptrdiff_t positionFrom, ptrdiff_t insertLength) { |
| 237 | PLATFORM_ASSERT((positionToInsert >= 0) && (positionToInsert <= lengthBody)); |
| 238 | if (insertLength > 0) { |
| 239 | if ((positionToInsert < 0) || (positionToInsert > lengthBody)) { |
| 240 | return; |
| 241 | } |
| 242 | RoomFor(insertLength); |
| 243 | GapTo(positionToInsert); |
| 244 | std::copy(s + positionFrom, s + positionFrom + insertLength, body.data() + part1Length); |
| 245 | lengthBody += insertLength; |
| 246 | part1Length += insertLength; |
| 247 | gapLength -= insertLength; |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | /// Delete one element from the buffer. |
| 252 | void Delete(ptrdiff_t position) { |
no test coverage detected