MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / get_cbor_array

Method get_cbor_array

Source/Utils/json.hpp:8675–8705  ·  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

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