MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / EndsWithCaseInsensitive

Method EndsWithCaseInsensitive

rtpose_wrapper/src/gtest/gtest-all.cpp:2982–2991  ·  view source on GitHub ↗

Returns true iff this String ends with the given suffix, ignoring case. Any String is considered to end with a NULL or empty suffix.

Source from the content-addressed store, hash-verified

2980// Returns true iff this String ends with the given suffix, ignoring case.
2981// Any String is considered to end with a NULL or empty suffix.
2982bool String::EndsWithCaseInsensitive(const char* suffix) const {
2983 if (suffix == NULL || CStringEquals(suffix, "")) return true;
2984
2985 if (c_str() == NULL) return false;
2986
2987 const size_t this_len = strlen(c_str());
2988 const size_t suffix_len = strlen(suffix);
2989 return (this_len >= suffix_len) &&
2990 CaseInsensitiveCStringEquals(c_str() + this_len - suffix_len, suffix);
2991}
2992
2993// Formats a list of arguments to a String, using the same format
2994// spec string as for printf.

Callers 1

RemoveExtensionMethod · 0.80

Calls 1

c_strFunction · 0.85

Tested by

no test coverage detected