! @param[in] len the length of the array or std::size_t(-1) for an array of indefinite size @return whether array creation completed */
| 5926 | @return whether array creation completed |
| 5927 | */ |
| 5928 | bool get_cbor_array(const std::size_t len) |
| 5929 | { |
| 5930 | if (JSON_HEDLEY_UNLIKELY(not sax->start_array(len))) |
| 5931 | { |
| 5932 | return false; |
| 5933 | } |
| 5934 | |
| 5935 | if (len != std::size_t(-1)) |
| 5936 | { |
| 5937 | for (std::size_t i = 0; i < len; ++i) |
| 5938 | { |
| 5939 | if (JSON_HEDLEY_UNLIKELY(not parse_cbor_internal())) |
| 5940 | { |
| 5941 | return false; |
| 5942 | } |
| 5943 | } |
| 5944 | } |
| 5945 | else |
| 5946 | { |
| 5947 | while (get() != 0xFF) |
| 5948 | { |
| 5949 | if (JSON_HEDLEY_UNLIKELY(not parse_cbor_internal(false))) |
| 5950 | { |
| 5951 | return false; |
| 5952 | } |
| 5953 | } |
| 5954 | } |
| 5955 | |
| 5956 | return sax->end_array(); |
| 5957 | } |
| 5958 | |
| 5959 | /*! |
| 5960 | @param[in] len the length of the object or std::size_t(-1) for an |
nothing calls this directly
no test coverage detected