MCPcopy Create free account
hub / github.com/ZDoom/Raze / char_length

Method char_length

libraries/ZWidget/src/core/utf8reader.cpp:89–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89std::string::size_type UTF8Reader::char_length()
90{
91 if (current_position < length)
92 {
93 int trailing_bytes = trailing_bytes_for_utf8[data[current_position]];
94 if (current_position + 1 + trailing_bytes > length)
95 return 1;
96
97 for (std::string::size_type i = 0; i < trailing_bytes; i++)
98 {
99 if ((data[current_position + 1 + i] & 0xC0) != 0x80)
100 return 1;
101 }
102
103 return 1 + trailing_bytes;
104 }
105 else
106 {
107 return 0;
108 }
109}
110
111void UTF8Reader::prev()
112{

Callers 4

BackspaceMethod · 0.80
DelMethod · 0.80
BackspaceMethod · 0.80
DelMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected