! @param[in] len the length of the array or std::size_t(-1) for an array of indefinite size @return whether array creation completed */
| 7115 | @return whether array creation completed |
| 7116 | */ |
| 7117 | bool get_cbor_array(const std::size_t len) |
| 7118 | { |
| 7119 | if (JSON_UNLIKELY(not sax->start_array(len))) |
| 7120 | { |
| 7121 | return false; |
| 7122 | } |
| 7123 | |
| 7124 | if (len != std::size_t(-1)) |
| 7125 | { |
| 7126 | for (std::size_t i = 0; i < len; ++i) |
| 7127 | { |
| 7128 | if (JSON_UNLIKELY(not parse_cbor_internal())) |
| 7129 | { |
| 7130 | return false; |
| 7131 | } |
| 7132 | } |
| 7133 | } |
| 7134 | else |
| 7135 | { |
| 7136 | while (get() != 0xFF) |
| 7137 | { |
| 7138 | if (JSON_UNLIKELY(not parse_cbor_internal(false))) |
| 7139 | { |
| 7140 | return false; |
| 7141 | } |
| 7142 | } |
| 7143 | } |
| 7144 | |
| 7145 | return sax->end_array(); |
| 7146 | } |
| 7147 | |
| 7148 | /*! |
| 7149 | @param[in] len the length of the object or std::size_t(-1) for an |
nothing calls this directly
no test coverage detected