| 169 | } |
| 170 | |
| 171 | bool String::endsWith(const std::string &str, const std::string &suffix, bool sensitive) |
| 172 | { |
| 173 | if (str.length() < suffix.length()) |
| 174 | return false; |
| 175 | if (sensitive) |
| 176 | { |
| 177 | return str.compare(str.length() - suffix.length(), suffix.length(), suffix) == 0; |
| 178 | } |
| 179 | return std::equal(suffix.rbegin(), suffix.rend(), str.rbegin(), charEqualsIgnoreCase); |
| 180 | } |
| 181 | |
| 182 | bool String::startsWith(const std::string &str, const std::vector<std::string> &prefixes, bool sensitive) |
| 183 | { |
nothing calls this directly
no outgoing calls
no test coverage detected