MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / DecodeAdvanceUTF8

Function DecodeAdvanceUTF8

src/String.cpp:159–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157}
158
159static inline int DecodeAdvanceUTF8(const unsigned char * &ioPtr)
160{
161 int c = *ioPtr++;
162 if( c < 0x80 )
163 {
164 return c;
165 }
166 else if( c < 0xE0 )
167 {
168 return ((c & 0x3F) << 6) | ((*ioPtr++) & 0x7F);
169 }
170 else if( c < 0xF0 )
171 {
172 int c2 = *ioPtr++;
173 return ((c & 0x1F) << 12) | ((c2 & 0x7F) << 6) | ( (*ioPtr++) & 0x7F);
174 }
175
176 int c2 = *ioPtr++;
177 int c3 = *ioPtr++;
178 return ((c & 0x0F) << 18) | ((c2 & 0x7F) << 12) | ((c3 & 0x7F) << 6) | ((*ioPtr++) & 0x7F);
179}
180
181static inline int DecodeAdvanceUTF8(const unsigned char * &ioPtr,const unsigned char *end)
182{

Callers 9

_hx_utf8_decode_advanceFunction · 0.85
_hx_utf8_iterFunction · 0.85
_hx_utf8_char_code_atFunction · 0.85
_hx_utf8_to_utf16Function · 0.85
wc_strMethod · 0.85
wchar_strMethod · 0.85
splitMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected