MCPcopy Create free account
hub / github.com/cxasm/notepad-- / InsertFromArray

Method InsertFromArray

src/qscint/scintilla/src/SplitVector.h:236–249  ·  view source on GitHub ↗

Insert text into the buffer from an array.

Source from the content-addressed store, hash-verified

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) {

Callers 1

BasicInsertStringMethod · 0.80

Calls 2

copyFunction · 0.85
dataMethod · 0.80

Tested by

no test coverage detected