MCPcopy Create free account
hub / github.com/cinder/Cinder / next

Function next

include/utf8cpp/unchecked.h:61–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59
60 template <typename octet_iterator>
61 uint32_t next(octet_iterator& it)
62 {
63 uint32_t cp = utf8::internal::mask8(*it);
64 typename std::iterator_traits<octet_iterator>::difference_type length = utf8::internal::sequence_length(it);
65 switch (length) {
66 case 1:
67 break;
68 case 2:
69 it++;
70 cp = ((cp << 6) & 0x7ff) + ((*it) & 0x3f);
71 break;
72 case 3:
73 ++it;
74 cp = ((cp << 12) & 0xffff) + ((utf8::internal::mask8(*it) << 6) & 0xfff);
75 ++it;
76 cp += (*it) & 0x3f;
77 break;
78 case 4:
79 ++it;
80 cp = ((cp << 18) & 0x1fffff) + ((utf8::internal::mask8(*it) << 12) & 0x3ffff);
81 ++it;
82 cp += (utf8::internal::mask8(*it) << 6) & 0xfff;
83 ++it;
84 cp += (*it) & 0x3f;
85 break;
86 }
87 ++it;
88 return cp;
89 }
90
91 template <typename octet_iterator>
92 uint32_t peek_next(octet_iterator it)

Callers 7

peek_nextFunction · 0.70
priorFunction · 0.70
advanceFunction · 0.70
distanceFunction · 0.70
utf8to16Function · 0.70
utf8to32Function · 0.70
operator *Method · 0.70

Calls 2

mask8Function · 0.85
sequence_lengthFunction · 0.85

Tested by

no test coverage detected