MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / ParseHexNum

Method ParseHexNum

native/thirdpart/flatbuffers/idl_parser.cpp:305–315  ·  view source on GitHub ↗

Parses exactly nibbles worth of hex digits into a number, or error.

Source from the content-addressed store, hash-verified

303
304// Parses exactly nibbles worth of hex digits into a number, or error.
305CheckedError Parser::ParseHexNum(int nibbles, uint64_t *val) {
306 FLATBUFFERS_ASSERT(nibbles > 0);
307 for (int i = 0; i < nibbles; i++)
308 if (!is_xdigit(cursor_[i]))
309 return Error("escape code must be followed by " + NumToString(nibbles) +
310 " hex digits");
311 std::string target(cursor_, cursor_ + nibbles);
312 *val = StringToUInt(target.c_str(), 16);
313 cursor_ += nibbles;
314 return NoError();
315}
316
317CheckedError Parser::SkipByteOrderMark() {
318 if (static_cast<unsigned char>(*cursor_) != 0xef) return NoError();

Callers

nothing calls this directly

Calls 6

is_xdigitFunction · 0.85
ErrorFunction · 0.85
NumToStringFunction · 0.85
StringToUIntFunction · 0.85
NoErrorFunction · 0.85
c_strMethod · 0.45

Tested by

no test coverage detected