10302 {
10304 {
10305 case 'U':
10306 {
10307 std::uint8_t number{};
10308
10309 if (JSON_HEDLEY_UNLIKELY(!get_number(input_format_t::ubjson, number)))
10310 {
10311 return false;
10312 }
10313
10314 result = static_cast<std::size_t>(number);
10315 return true;
10316 }
10317
10318 case 'i':
10319 {
10320 std::int8_t number{};
10321
10322 if (JSON_HEDLEY_UNLIKELY(!get_number(input_format_t::ubjson, number)))
10323 {
10324 return false;
10325 }
10326
10327 result = static_cast<std::size_t>(number);
10328 return true;
10329 }
10330
10331 case 'I':
10332 {
10333 std::int16_t number{};
10334
10335 if (JSON_HEDLEY_UNLIKELY(!get_number(input_format_t::ubjson, number)))
10336 {
10337 return false;
10338 }
10339
10340 result = static_cast<std::size_t>(number);
10341 return true;
10342 }
10343
10344 case 'l':
10345 {
10346 std::int32_t number{};
10347
10348 if (JSON_HEDLEY_UNLIKELY(!get_number(input_format_t::ubjson, number)))
10349 {
10350 return false;
10351 }
10352
10353 result = static_cast<std::size_t>(number);
10354 return true;
10355 }
10356
10357 case 'L':
10358 {
10359 std::int64_t number{};
10360
10361 if (JSON_HEDLEY_UNLIKELY(!get_number(input_format_t::ubjson, number)))
10362 {
10363 return false;
10364 }
10365
10366 result = static_cast<std::size_t>(number);
10367 return true;
10368 }
10369
10370 default:
10371 {
10373 return sax->parse_error(
chars_read, last_token,
parse_error::create(113,
chars_read,
exception_message(input_format_t::ubjson,
"expected length type specification (U, i, I, l, L) after '#'; last byte: 0x" + last_token,
"size"), BasicJsonType()));
10374 }
10375 }
10376 }
char_int_type get_ignore_noop()
std::string get_token_string() const
std::string exception_message(const input_format_t format, const std::string &detail, const std::string &context) const
std::size_t chars_read
the number of characters read
json_sax_t * sax
the SAX parser
static parse_error create(int id_, const position_t &pos, const std::string &what_arg, const BasicJsonType &context)
create a parse error exception