Returns true iff str ends with the given suffix, ignoring case. Any string is considered to end with an empty suffix.
| 3439 | // Returns true iff str ends with the given suffix, ignoring case. |
| 3440 | // Any string is considered to end with an empty suffix. |
| 3441 | bool String::EndsWithCaseInsensitive( |
| 3442 | const std::string& str, const std::string& suffix) { |
| 3443 | const size_t str_len = str.length(); |
| 3444 | const size_t suffix_len = suffix.length(); |
| 3445 | return (str_len >= suffix_len) && |
| 3446 | CaseInsensitiveCStringEquals(str.c_str() + str_len - suffix_len, |
| 3447 | suffix.c_str()); |
| 3448 | } |
| 3449 | |
| 3450 | // Formats an int value as "%02d". |
| 3451 | std::string String::FormatIntWidth2(int value) { |
nothing calls this directly
no outgoing calls
no test coverage detected