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

Method cut

Engine/source/core/stringBuffer.cpp:328–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 5

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

Calls 5

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

Tested by

no test coverage detected