MCPcopy Create free account
hub / github.com/Kitware/CMake / Capitalized

Method Capitalized

Source/kwsys/SystemTools.cxx:1654–1666  ·  view source on GitHub ↗

Return a capitalized string (i.e the first letter is uppercased, all other are lowercased)

Source from the content-addressed store, hash-verified

1652// Return a capitalized string (i.e the first letter is uppercased, all other
1653// are lowercased)
1654std::string SystemTools::Capitalized(std::string const& s)
1655{
1656 std::string n;
1657 if (s.empty()) {
1658 return n;
1659 }
1660 n.resize(s.size());
1661 n[0] = static_cast<std::string::value_type>(kwsysString_toupper(s[0]));
1662 for (size_t i = 1; i < s.size(); i++) {
1663 n[i] = static_cast<std::string::value_type>(kwsysString_tolower(s[i]));
1664 }
1665 return n;
1666}
1667
1668// Return capitalized words
1669std::string SystemTools::CapitalizedWords(std::string const& s)

Callers

nothing calls this directly

Calls 5

kwsysString_toupperFunction · 0.85
kwsysString_tolowerFunction · 0.85
emptyMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected