MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / caseInsensitiveStringCompare

Function caseInsensitiveStringCompare

lib/utils.cpp:27–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25
26
27int caseInsensitiveStringCompare(const std::string &lhs, const std::string &rhs)
28{
29 if (lhs.size() != rhs.size())
30 return (lhs.size() < rhs.size()) ? -1 : 1;
31 for (unsigned int i = 0; i < lhs.size(); ++i) {
32 const int c1 = std::toupper(lhs[i]);
33 const int c2 = std::toupper(rhs[i]);
34 if (c1 != c2)
35 return (c1 < c2) ? -1 : 1;
36 }
37 return 0;
38}
39
40bool isValidGlobPattern(const std::string& pattern)
41{

Callers 3

getClassificationFunction · 0.85
operator()Method · 0.85
sameFileNameMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected