! @param[in] len the length of the array or static_cast (-1) for an array of indefinite size @param[in] tag_handler how CBOR tags should be treated @return whether array creation completed */
| 10174 | @return whether array creation completed |
| 10175 | */ |
| 10176 | bool get_cbor_array(const std::size_t len, |
| 10177 | const cbor_tag_handler_t tag_handler) |
| 10178 | { |
| 10179 | if (JSON_HEDLEY_UNLIKELY(!sax->start_array(len))) |
| 10180 | { |
| 10181 | return false; |
| 10182 | } |
| 10183 | |
| 10184 | if (len != static_cast<std::size_t>(-1)) |
| 10185 | { |
| 10186 | for (std::size_t i = 0; i < len; ++i) |
| 10187 | { |
| 10188 | if (JSON_HEDLEY_UNLIKELY(!parse_cbor_internal(true, tag_handler))) |
| 10189 | { |
| 10190 | return false; |
| 10191 | } |
| 10192 | } |
| 10193 | } |
| 10194 | else |
| 10195 | { |
| 10196 | while (get() != 0xFF) |
| 10197 | { |
| 10198 | if (JSON_HEDLEY_UNLIKELY(!parse_cbor_internal(false, tag_handler))) |
| 10199 | { |
| 10200 | return false; |
| 10201 | } |
| 10202 | } |
| 10203 | } |
| 10204 | |
| 10205 | return sax->end_array(); |
| 10206 | } |
| 10207 | |
| 10208 | /*! |
| 10209 | @param[in] len the length of the object or static_cast<std::size_t>(-1) for an |
nothing calls this directly
no test coverage detected