| 326 | } |
| 327 | |
| 328 | void 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 | |
| 348 | const UTF16 StringBuffer::getChar(const U32 offset) const |
| 349 | { |
no test coverage detected