MCPcopy Create free account
hub / github.com/catchorg/Catch2 / endsWith

Function endsWith

extras/catch_amalgamated.cpp:6946–6948  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6944 return !s.empty() && s[0] == prefix;
6945 }
6946 bool endsWith( std::string const& s, std::string const& suffix ) {
6947 return s.size() >= suffix.size() && std::equal(suffix.rbegin(), suffix.rend(), s.rbegin());
6948 }
6949 bool endsWith( std::string const& s, char suffix ) {
6950 return !s.empty() && s[s.size()-1] == suffix;
6951 }

Callers 4

addMethod · 0.70
WildcardPatternMethod · 0.70
matchesMethod · 0.70
matchMethod · 0.70

Calls 2

sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected