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

Function sequence_length

include/utf8cpp/core.h:99–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97
98 template <typename octet_iterator>
99 inline typename std::iterator_traits<octet_iterator>::difference_type
100 sequence_length(octet_iterator lead_it)
101 {
102 uint8_t lead = utf8::internal::mask8(*lead_it);
103 if (lead < 0x80)
104 return 1;
105 else if ((lead >> 5) == 0x6)
106 return 2;
107 else if ((lead >> 4) == 0xe)
108 return 3;
109 else if ((lead >> 3) == 0x1e)
110 return 4;
111 else
112 return 0;
113 }
114
115 template <typename octet_difference_type>
116 inline bool is_overlong_sequence(uint32_t cp, octet_difference_type length)

Callers 4

nextFunction · 0.85
iteratorClass · 0.85
operator ++Method · 0.85
validate_nextFunction · 0.85

Calls 1

mask8Function · 0.85

Tested by

no test coverage detected