! @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 */
| 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 |
nothing calls this directly
no test coverage detected