MCPcopy Create free account
hub / github.com/bytedance/bolt / peekCodePoint

Method peekCodePoint

bolt/type/Tokenizer.cpp:262–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260}
261
262char32_t DefaultTokenizer::peekCodePoint() {
263 if (index_ >= path_.size()) {
264 return 0;
265 }
266 const unsigned char* p =
267 reinterpret_cast<const unsigned char*>(path_.data() + index_);
268 const unsigned char* e =
269 reinterpret_cast<const unsigned char*>(path_.data() + path_.size());
270 const unsigned char* orig = p;
271 char32_t cp = folly::utf8ToCodePoint(p, e, /*skipOnError=*/false);
272 if (p == orig) {
273 invalidSubfieldPath(); // Invalid UTF-8
274 }
275 return cp;
276}
277
278void DefaultTokenizer::consumeCodePoint() {
279 if (index_ >= path_.size())

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected