MCPcopy Create free account
hub / github.com/comaps/comaps / AsciiToLower

Function AsciiToLower

libs/base/string_utils.cpp:202–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200}
201
202void AsciiToLower(std::string & s)
203{
204 std::transform(s.begin(), s.end(), s.begin(), [](char in)
205 {
206 char constexpr diff = 'z' - 'Z';
207 static_assert(diff == 'a' - 'A');
208 static_assert(diff > 0);
209
210 if (in >= 'A' && in <= 'Z')
211 return char(in + diff);
212 return in;
213 });
214}
215
216void AsciiToUpper(std::string & s)
217{

Callers 15

AddAttrMethod · 0.85
MapLocaleToIntegerMethod · 0.85
FindNetworkShieldMethod · 0.85
ParseRoadShieldMethod · 0.85
SetFeedLanguageMethod · 0.85
UNIT_TESTFunction · 0.85
AddLanguageMethod · 0.85
GetTwineFunction · 0.85

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by 1

UNIT_TESTFunction · 0.68