Parses exactly nibbles worth of hex digits into a number, or error.
| 453 | |
| 454 | // Parses exactly nibbles worth of hex digits into a number, or error. |
| 455 | CheckedError 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 | |
| 467 | CheckedError Parser::SkipByteOrderMark() { |
| 468 | if (static_cast<unsigned char>(*cursor_) != 0xef) return NoError(); |
nothing calls this directly
no test coverage detected