MCPcopy Create free account
hub / github.com/AllentDan/LibtorchTutorials / get_cbor_array

Method get_cbor_array

lesson6-Segmentation/json.hpp:8676–8706  ·  view source on GitHub ↗

! @param[in] len the length of the array or std::size_t(-1) for an array of indefinite size @param[in] tag_handler how CBOR tags should be treated @return whether array creation completed */

Source from the content-addressed store, hash-verified

8674 @return whether array creation completed
8675 */
8676 bool get_cbor_array(const std::size_t len,
8677 const cbor_tag_handler_t tag_handler)
8678 {
8679 if (JSON_HEDLEY_UNLIKELY(!sax->start_array(len)))
8680 {
8681 return false;
8682 }
8683
8684 if (len != std::size_t(-1))
8685 {
8686 for (std::size_t i = 0; i < len; ++i)
8687 {
8688 if (JSON_HEDLEY_UNLIKELY(!parse_cbor_internal(true, tag_handler)))
8689 {
8690 return false;
8691 }
8692 }
8693 }
8694 else
8695 {
8696 while (get() != 0xFF)
8697 {
8698 if (JSON_HEDLEY_UNLIKELY(!parse_cbor_internal(false, tag_handler)))
8699 {
8700 return false;
8701 }
8702 }
8703 }
8704
8705 return sax->end_array();
8706 }
8707
8708 /*!
8709 @param[in] len the length of the object or std::size_t(-1) for an

Callers

nothing calls this directly

Calls 3

getFunction · 0.85
start_arrayMethod · 0.45
end_arrayMethod · 0.45

Tested by

no test coverage detected