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