! @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 */
| 8743 | @return whether array creation completed |
| 8744 | */ |
| 8745 | bool get_cbor_array(const std::size_t len, |
| 8746 | const cbor_tag_handler_t tag_handler) |
| 8747 | { |
| 8748 | if (JSON_HEDLEY_UNLIKELY(!sax->start_array(len))) |
| 8749 | { |
| 8750 | return false; |
| 8751 | } |
| 8752 | |
| 8753 | if (len != std::size_t(-1)) |
| 8754 | { |
| 8755 | for (std::size_t i = 0; i < len; ++i) |
| 8756 | { |
| 8757 | if (JSON_HEDLEY_UNLIKELY(!parse_cbor_internal(true, tag_handler))) |
| 8758 | { |
| 8759 | return false; |
| 8760 | } |
| 8761 | } |
| 8762 | } |
| 8763 | else |
| 8764 | { |
| 8765 | while (get() != 0xFF) |
| 8766 | { |
| 8767 | if (JSON_HEDLEY_UNLIKELY(!parse_cbor_internal(false, tag_handler))) |
| 8768 | { |
| 8769 | return false; |
| 8770 | } |
| 8771 | } |
| 8772 | } |
| 8773 | |
| 8774 | return sax->end_array(); |
| 8775 | } |
| 8776 | |
| 8777 | /*! |
| 8778 | @param[in] len the length of the object or std::size_t(-1) for an |
nothing calls this directly
no test coverage detected