MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / to_lower

Function to_lower

library/strings.cpp:49–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49UString to_lower(const UStringView str)
50{
51 /* Only change the case on ascii range characters (codepoint <=0x7f)
52 * As we know the top bit is set for any bytes outside this range no matter the position in the
53 * utf8 stream, we can cheat a bit here */
54 auto lower_string = UString(str);
55 for (size_t i = 0; i < lower_string.length(); i++)
56 {
57 if ((lower_string[i] & 0b10000000) == 0)
58 lower_string[i] = tolower(lower_string[i]);
59 }
60 return lower_string;
61}
62
63bool ends_with(const UStringView str, const UStringView ending)
64{

Callers 7

extractVehiclesMethod · 0.85
FromHtmlNameMethod · 0.85
FromHexMethod · 0.85
openMethod · 0.85
readDirMethod · 0.85
cueOpenArchiveMethod · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by 1

mainFunction · 0.68