MCPcopy Create free account
hub / github.com/defold/defold / NextChar

Function NextChar

engine/dlib/src/dlib/utf8.cpp:36–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34 };
35
36 uint32_t NextChar(const char** str) {
37 uint32_t c = 0;
38 int i = 0;
39 const char* s = *str;
40
41 // Edge-case for termination, see doc for behavior
42 // Not so pretty perhaps
43 if (*s == 0) {
44 return 0;
45 }
46
47 do {
48 c <<= 6;
49 c += (uint8_t)(*s);
50 ++s;
51 ++i;
52 } while (*s && (*s & 0xc0) == 0x80);
53
54 c -= offsets[i-1];
55 *str = s;
56 return c;
57 }
58
59 uint32_t ToUtf8(uint16_t chr, char* buf)
60 {

Callers 7

TESTFunction · 0.85
NextBreakFunction · 0.85
SkipWSFunction · 0.85
LayoutFunction · 0.85
TextToCodePointsFunction · 0.85
FontDebugFunction · 0.85
GetMaxCellSizeFunction · 0.85

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.68