| 217 | } |
| 218 | |
| 219 | inline bool endWith(std::string_view _source, std::string_view _value) |
| 220 | { |
| 221 | #if __cplusplus >= 202002L |
| 222 | return _source.ends_with(_value); |
| 223 | #else |
| 224 | size_t count = _value.size(); |
| 225 | if (_source.size() < count) |
| 226 | return false; |
| 227 | size_t offset = _source.size() - count; |
| 228 | for (size_t index = 0; index < count; ++index) |
| 229 | { |
| 230 | if (_source[index + offset] != _value[index]) |
| 231 | return false; |
| 232 | } |
| 233 | return true; |
| 234 | #endif |
| 235 | } |
| 236 | |
| 237 | } // namespace MyGUI |
| 238 |