TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ get_ubjson_object()

template<typename BasicJsonType , typename InputAdapterType , typename SAX = json_sax_dom_parser<BasicJsonType>>
bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_ubjson_object ( )
inlineprivate
Returns
whether object creation completed

Definition at line 10602 of file json.hpp.

10603 {
10604 std::pair<std::size_t, char_int_type> size_and_type;
10605
10606 if (JSON_HEDLEY_UNLIKELY(!get_ubjson_size_type(size_and_type)))
10607 {
10608 return false;
10609 }
10610
10611 string_t key;
10612
10613 if (size_and_type.first != string_t::npos)
10614 {
10615 if (JSON_HEDLEY_UNLIKELY(!sax->start_object(size_and_type.first)))
10616 {
10617 return false;
10618 }
10619
10620 if (size_and_type.second != 0)
10621 {
10622 for (std::size_t i = 0; i < size_and_type.first; ++i)
10623 {
10624 if (JSON_HEDLEY_UNLIKELY(!get_ubjson_string(key) || !sax->key(key)))
10625 {
10626 return false;
10627 }
10628
10629 if (JSON_HEDLEY_UNLIKELY(!get_ubjson_value(size_and_type.second)))
10630 {
10631 return false;
10632 }
10633
10634 key.clear();
10635 }
10636 }
10637
10638 else
10639 {
10640 for (std::size_t i = 0; i < size_and_type.first; ++i)
10641 {
10642 if (JSON_HEDLEY_UNLIKELY(!get_ubjson_string(key) || !sax->key(key)))
10643 {
10644 return false;
10645 }
10646
10647 if (JSON_HEDLEY_UNLIKELY(!parse_ubjson_internal()))
10648 {
10649 return false;
10650 }
10651
10652 key.clear();
10653 }
10654 }
10655 }
10656
10657 else
10658 {
10659 if (JSON_HEDLEY_UNLIKELY(!sax->start_object(std::size_t(-1))))
10660 {
10661 return false;
10662 }
10663
10664 while (current != '}')
10665 {
10666 if (JSON_HEDLEY_UNLIKELY(!get_ubjson_string(key, false) || !sax->key(key)))
10667 {
10668 return false;
10669 }
10670
10671 if (JSON_HEDLEY_UNLIKELY(!parse_ubjson_internal()))
10672 {
10673 return false;
10674 }
10675
10677 key.clear();
10678 }
10679 }
10680
10681 return sax->end_object();
10682 }
char_int_type get_ignore_noop()
Definition: json.hpp:10778
bool get_ubjson_string(string_t &result, const bool get_char=true)
reads a UBJSON string
Definition: json.hpp:10247
bool parse_ubjson_internal(const bool get_char=true)
Definition: json.hpp:10228
bool get_ubjson_size_type(std::pair< std::size_t, char_int_type > &result)
determine the type and size for a container
Definition: json.hpp:10388
bool get_ubjson_value(const char_int_type prefix)
Definition: json.hpp:10431
char_int_type current
the current character
Definition: json.hpp:10978
json_sax_t * sax
the SAX parser
Definition: json.hpp:10987
@ key
the parser read a key of a value in an object