MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / EndsWith

Function EndsWith

Bcore/src/main/cpp/android-base/strings.cpp:106–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106static bool EndsWith(const std::string& s, const char* suffix, size_t suffix_length,
107 bool case_sensitive) {
108 size_t string_length = s.size();
109 if (suffix_length > string_length) {
110 return false;
111 }
112 size_t offset = string_length - suffix_length;
113 return (case_sensitive ? strncmp : strncasecmp)(s.c_str() + offset, suffix, suffix_length) == 0;
114}
115
116bool EndsWith(const std::string& s, const char* suffix) {
117 return EndsWith(s, suffix, strlen(suffix), true);

Callers 1

EndsWithIgnoreCaseFunction · 0.70

Calls 2

c_strMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected