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

Function to_upper

library/strings.cpp:35–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35UString to_upper(const UStringView str)
36{
37 /* Only change the case on ascii range characters (codepoint <=0x7f)
38 * As we know the top bit is set for any bytes outside this range no matter the position in the
39 * utf8 stream, we can cheat a bit here */
40 auto upper_string = UString(str);
41 for (size_t i = 0; i < upper_string.length(); i++)
42 {
43 if ((upper_string[i] & 0b10000000) == 0)
44 upper_string[i] = toupper(upper_string[i]);
45 }
46 return upper_string;
47}
48
49UString to_lower(const UStringView str)
50{

Callers 11

MessageBoxMethod · 0.85
loadVoxelSliceMethod · 0.85
loadImageSetMethod · 0.85
loadSampleMethod · 0.85
loadImageMethod · 0.85
loadPaletteMethod · 0.85
loadPCXPaletteFunction · 0.85
parseStartMethod · 0.85
parseFileMethod · 0.85
parseTrackMethod · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by 1

mainFunction · 0.68