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

Function isStringCharLiteral

lib/utils.h:154–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152}
153
154inline static bool isStringCharLiteral(const std::string &str, char q)
155{
156 // early out to avoid the loop
157 if (!endsWith(str, q))
158 return false;
159
160 static const std::array<std::string, 5> suffixes{"", "u8", "u", "U", "L"};
161 return std::any_of(suffixes.cbegin(), suffixes.cend(), [&](const std::string& p) {
162 return isPrefixStringCharLiteral(str, q, p);
163 });
164}
165
166inline static bool isStringLiteral(const std::string &str)
167{

Callers 2

isStringLiteralFunction · 0.85
isCharLiteralFunction · 0.85

Calls 2

endsWithFunction · 0.70

Tested by

no test coverage detected