TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ get_ubjson_size_type()

template<typename BasicJsonType , typename InputAdapterType , typename SAX = json_sax_dom_parser<BasicJsonType>>
bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_ubjson_size_type ( std::pair< std::size_t, char_int_type > &  result)
inlineprivate

determine the type and size for a container

In the optimized UBJSON format, a type and a size can be provided to allow for a more compact representation.

Parameters
[out]resultpair of the size and the type
Returns
whether pair creation completed

Definition at line 10388 of file json.hpp.

10389 {
10390 result.first = string_t::npos; // size
10391 result.second = 0; // type
10393
10394 if (current == '$')
10395 {
10396 result.second = get(); // must not ignore 'N', because 'N' maybe the type
10397
10398 if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::ubjson, "type")))
10399 {
10400 return false;
10401 }
10402
10404
10405 if (JSON_HEDLEY_UNLIKELY(current != '#'))
10406 {
10407 if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::ubjson, "value")))
10408 {
10409 return false;
10410 }
10411
10412 auto last_token = get_token_string();
10413 return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::ubjson, "expected '#' after type information; last byte: 0x" + last_token, "size"), BasicJsonType()));
10414 }
10415
10416 return get_ubjson_size_value(result.first);
10417 }
10418
10419 if (current == '#')
10420 {
10421 return get_ubjson_size_value(result.first);
10422 }
10423
10424 return true;
10425 }
char_int_type get_ignore_noop()
Definition: json.hpp:10778
bool unexpect_eof(const input_format_t format, const char *context) const
Definition: json.hpp:10914
std::string get_token_string() const
Definition: json.hpp:10928
std::string exception_message(const input_format_t format, const std::string &detail, const std::string &context) const
Definition: json.hpp:10941
std::size_t chars_read
the number of characters read
Definition: json.hpp:10981
char_int_type current
the current character
Definition: json.hpp:10978
json_sax_t * sax
the SAX parser
Definition: json.hpp:10987
bool get_ubjson_size_value(std::size_t &result)
Definition: json.hpp:10301
char_int_type get()
get next character from the input
Definition: json.hpp:10769
static parse_error create(int id_, const position_t &pos, const std::string &what_arg, const BasicJsonType &context)
create a parse error exception
Definition: json.hpp:2800