Delete a range from the buffer. Deleting positions outside the current range fails.
| 217 | /// Delete a range from the buffer. |
| 218 | /// Deleting positions outside the current range fails. |
| 219 | void DeleteRange(int position, int deleteLength) { |
| 220 | PLATFORM_ASSERT((position >= 0) && (position + deleteLength <= lengthBody)); |
| 221 | if ((position < 0) || ((position + deleteLength) > lengthBody)) { |
| 222 | return; |
| 223 | } |
| 224 | if ((position == 0) && (deleteLength == lengthBody)) { |
| 225 | // Full deallocation returns storage and is faster |
| 226 | delete []body; |
| 227 | Init(); |
| 228 | } else if (deleteLength > 0) { |
| 229 | GapTo(position); |
| 230 | lengthBody -= deleteLength; |
| 231 | gapLength += deleteLength; |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | /// Delete all the buffer contents. |
| 236 | void DeleteAll() { |
nothing calls this directly
no outgoing calls
no test coverage detected