| 341 | } |
| 342 | |
| 343 | bool SimpleString::endsWith(const SimpleString& other) const |
| 344 | { |
| 345 | size_t length = size(); |
| 346 | size_t other_length = other.size(); |
| 347 | |
| 348 | if (other_length == 0) return true; |
| 349 | if (length == 0) return false; |
| 350 | if (length < other_length) return false; |
| 351 | |
| 352 | return StrCmp(getBuffer() + length - other_length, other.getBuffer()) == 0; |
| 353 | } |
| 354 | |
| 355 | size_t SimpleString::count(const SimpleString& substr) const |
| 356 | { |