This function is either called after reading the 'S' byte explicitly indicating a string, or in case of an object key where the 'S' byte can be left out.
10248 {
10249 if (get_char)
10250 {
10252 }
10253
10254 if (JSON_HEDLEY_UNLIKELY(!
unexpect_eof(input_format_t::ubjson,
"value")))
10255 {
10256 return false;
10257 }
10258
10260 {
10261 case 'U':
10262 {
10263 std::uint8_t len{};
10264 return get_number(input_format_t::ubjson, len) &&
get_string(input_format_t::ubjson, len, result);
10265 }
10266
10267 case 'i':
10268 {
10269 std::int8_t len{};
10270 return get_number(input_format_t::ubjson, len) &&
get_string(input_format_t::ubjson, len, result);
10271 }
10272
10273 case 'I':
10274 {
10275 std::int16_t len{};
10276 return get_number(input_format_t::ubjson, len) &&
get_string(input_format_t::ubjson, len, result);
10277 }
10278
10279 case 'l':
10280 {
10281 std::int32_t len{};
10282 return get_number(input_format_t::ubjson, len) &&
get_string(input_format_t::ubjson, len, result);
10283 }
10284
10285 case 'L':
10286 {
10287 std::int64_t len{};
10288 return get_number(input_format_t::ubjson, len) &&
get_string(input_format_t::ubjson, len, result);
10289 }
10290
10291 default:
10293 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); last byte: 0x" + last_token,
"string"), BasicJsonType()));
10294 }
10295 }
bool get_string(const input_format_t format, const NumberType len, string_t &result)
create a string by reading characters from the input
bool unexpect_eof(const input_format_t format, const char *context) const
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
char_int_type current
the current character
json_sax_t * sax
the SAX parser
char_int_type get()
get next character from the input
static parse_error create(int id_, const position_t &pos, const std::string &what_arg, const BasicJsonType &context)
create a parse error exception