TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ get_cbor_object()

template<typename BasicJsonType , typename InputAdapterType , typename SAX = json_sax_dom_parser<BasicJsonType>>
bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_cbor_object ( const std::size_t  len,
const cbor_tag_handler_t  tag_handler 
)
inlineprivate
Parameters
[in]lenthe length of the object or std::size_t(-1) for an object of indefinite size
[in]tag_handlerhow CBOR tags should be treated
Returns
whether object creation completed

Definition at line 9532 of file json.hpp.

9534 {
9535 if (JSON_HEDLEY_UNLIKELY(!sax->start_object(len)))
9536 {
9537 return false;
9538 }
9539
9540 if (len != 0)
9541 {
9542 string_t key;
9543
9544 if (len != std::size_t(-1))
9545 {
9546 for (std::size_t i = 0; i < len; ++i)
9547 {
9548 get();
9549
9550 if (JSON_HEDLEY_UNLIKELY(!get_cbor_string(key) || !sax->key(key)))
9551 {
9552 return false;
9553 }
9554
9555 if (JSON_HEDLEY_UNLIKELY(!parse_cbor_internal(true, tag_handler)))
9556 {
9557 return false;
9558 }
9559
9560 key.clear();
9561 }
9562 }
9563
9564 else
9565 {
9566 while (get() != 0xFF)
9567 {
9568 if (JSON_HEDLEY_UNLIKELY(!get_cbor_string(key) || !sax->key(key)))
9569 {
9570 return false;
9571 }
9572
9573 if (JSON_HEDLEY_UNLIKELY(!parse_cbor_internal(true, tag_handler)))
9574 {
9575 return false;
9576 }
9577
9578 key.clear();
9579 }
9580 }
9581 }
9582
9583 return sax->end_object();
9584 }
bool parse_cbor_internal(const bool get_char, const cbor_tag_handler_t tag_handler)
Definition: json.hpp:8794
bool get_cbor_string(string_t &result)
reads a CBOR string
Definition: json.hpp:9298
json_sax_t * sax
the SAX parser
Definition: json.hpp:10987
char_int_type get()
get next character from the input
Definition: json.hpp:10769
@ key
the parser read a key of a value in an object