! @return whether array creation completed */
| 9689 | @return whether array creation completed |
| 9690 | */ |
| 9691 | bool get_ubjson_array() |
| 9692 | { |
| 9693 | std::pair<std::size_t, char_int_type> size_and_type; |
| 9694 | if (JSON_HEDLEY_UNLIKELY(!get_ubjson_size_type(size_and_type))) |
| 9695 | { |
| 9696 | return false; |
| 9697 | } |
| 9698 | |
| 9699 | if (size_and_type.first != string_t::npos) |
| 9700 | { |
| 9701 | if (JSON_HEDLEY_UNLIKELY(!sax->start_array(size_and_type.first))) |
| 9702 | { |
| 9703 | return false; |
| 9704 | } |
| 9705 | |
| 9706 | if (size_and_type.second != 0) |
| 9707 | { |
| 9708 | if (size_and_type.second != 'N') |
| 9709 | { |
| 9710 | for (std::size_t i = 0; i < size_and_type.first; ++i) |
| 9711 | { |
| 9712 | if (JSON_HEDLEY_UNLIKELY(!get_ubjson_value(size_and_type.second))) |
| 9713 | { |
| 9714 | return false; |
| 9715 | } |
| 9716 | } |
| 9717 | } |
| 9718 | } |
| 9719 | else |
| 9720 | { |
| 9721 | for (std::size_t i = 0; i < size_and_type.first; ++i) |
| 9722 | { |
| 9723 | if (JSON_HEDLEY_UNLIKELY(!parse_ubjson_internal())) |
| 9724 | { |
| 9725 | return false; |
| 9726 | } |
| 9727 | } |
| 9728 | } |
| 9729 | } |
| 9730 | else |
| 9731 | { |
| 9732 | if (JSON_HEDLEY_UNLIKELY(!sax->start_array(std::size_t(-1)))) |
| 9733 | { |
| 9734 | return false; |
| 9735 | } |
| 9736 | |
| 9737 | while (current != ']') |
| 9738 | { |
| 9739 | if (JSON_HEDLEY_UNLIKELY(!parse_ubjson_internal(false))) |
| 9740 | { |
| 9741 | return false; |
| 9742 | } |
| 9743 | get_ignore_noop(); |
| 9744 | } |
| 9745 | } |
| 9746 | |
| 9747 | return sax->end_array(); |
| 9748 | } |
nothing calls this directly
no test coverage detected