MCPcopy Create free account
hub / github.com/catboost/catboost / ParseHexNum

Method ParseHexNum

contrib/libs/flatbuffers/src/idl_parser.cpp:455–465  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

453
454// Parses exactly nibbles worth of hex digits into a number, or error.
455CheckedError Parser::ParseHexNum(int nibbles, uint64_t *val) {
456 FLATBUFFERS_ASSERT(nibbles > 0);
457 for (int i = 0; i < nibbles; i++)
458 if (!is_xdigit(cursor_[i]))
459 return Error("escape code must be followed by " + NumToString(nibbles) +
460 " hex digits");
461 std::string target(cursor_, cursor_ + nibbles);
462 *val = StringToUInt(target.c_str(), 16);
463 cursor_ += nibbles;
464 return NoError();
465}
466
467CheckedError Parser::SkipByteOrderMark() {
468 if (static_cast<unsigned char>(*cursor_) != 0xef) return NoError();

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected