MCPcopy Create free account
hub / github.com/apache/trafficserver / IsFlexibleCase

Function IsFlexibleCase

lib/yamlcpp/src/convert.cpp:27–37  ·  view source on GitHub ↗

IsFlexibleCase . Returns true if 'str' is: . UPPERCASE . lowercase . Capitalized

Source from the content-addressed store, hash-verified

25// . lowercase
26// . Capitalized
27bool IsFlexibleCase(const std::string& str) {
28 if (str.empty())
29 return true;
30
31 if (IsEntirely(str, IsLower))
32 return true;
33
34 bool firstcaps = IsUpper(str[0]);
35 std::string rest = str.substr(1);
36 return firstcaps && (IsEntirely(rest, IsLower) || IsEntirely(rest, IsUpper));
37}
38} // namespace
39
40namespace YAML {

Callers 1

decodeMethod · 0.85

Calls 4

IsEntirelyFunction · 0.85
IsUpperFunction · 0.85
emptyMethod · 0.45
substrMethod · 0.45

Tested by

no test coverage detected