MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / cut

Method cut

Engine/source/core/stringBuffer.cpp:326–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324}
325
326void StringBuffer::cut(const U32 start, const U32 len)
327{
328 AssertFatal(start < length(), "StringBuffer::cut - invalid start!");
329 AssertFatal(start+len <= length(), "StringBuffer::cut - invalid len!");
330 AssertFatal(len > 0, "StringBuffer::cut - len >= 1.");
331
332 AssertFatal(mBuffer.last() == 0, "StringBuffer::cut - not a null terminated string! (pre)");
333
334 // Now snip things.
335 for(S32 i=start; i<mBuffer.size()-len; i++)
336 mBuffer[i] = mBuffer[i+len];
337 mBuffer.decrement(len);
338 mBuffer.compact();
339
340 AssertFatal(mBuffer.last() == 0, "StringBuffer::cut - not a null terminated string! (post)");
341
342 // mark utf8 buffer dirty
343 mDirty8 = true;
344}
345
346const UTF16 StringBuffer::getChar(const U32 offset) const
347{

Callers 5

onCopyMethod · 0.80
onPasteMethod · 0.80
onKeyDownMethod · 0.80
handleCharInputMethod · 0.80
deleteCharsMethod · 0.80

Calls 5

lastMethod · 0.80
decrementMethod · 0.80
lengthFunction · 0.50
sizeMethod · 0.45
compactMethod · 0.45

Tested by

no test coverage detected