! @return whether object creation completed */
| 9751 | @return whether object creation completed |
| 9752 | */ |
| 9753 | bool get_ubjson_object() |
| 9754 | { |
| 9755 | std::pair<std::size_t, char_int_type> size_and_type; |
| 9756 | if (JSON_HEDLEY_UNLIKELY(!get_ubjson_size_type(size_and_type))) |
| 9757 | { |
| 9758 | return false; |
| 9759 | } |
| 9760 | |
| 9761 | string_t key; |
| 9762 | if (size_and_type.first != string_t::npos) |
| 9763 | { |
| 9764 | if (JSON_HEDLEY_UNLIKELY(!sax->start_object(size_and_type.first))) |
| 9765 | { |
| 9766 | return false; |
| 9767 | } |
| 9768 | |
| 9769 | if (size_and_type.second != 0) |
| 9770 | { |
| 9771 | for (std::size_t i = 0; i < size_and_type.first; ++i) |
| 9772 | { |
| 9773 | if (JSON_HEDLEY_UNLIKELY(!get_ubjson_string(key) || !sax->key(key))) |
| 9774 | { |
| 9775 | return false; |
| 9776 | } |
| 9777 | if (JSON_HEDLEY_UNLIKELY(!get_ubjson_value(size_and_type.second))) |
| 9778 | { |
| 9779 | return false; |
| 9780 | } |
| 9781 | key.clear(); |
| 9782 | } |
| 9783 | } |
| 9784 | else |
| 9785 | { |
| 9786 | for (std::size_t i = 0; i < size_and_type.first; ++i) |
| 9787 | { |
| 9788 | if (JSON_HEDLEY_UNLIKELY(!get_ubjson_string(key) || !sax->key(key))) |
| 9789 | { |
| 9790 | return false; |
| 9791 | } |
| 9792 | if (JSON_HEDLEY_UNLIKELY(!parse_ubjson_internal())) |
| 9793 | { |
| 9794 | return false; |
| 9795 | } |
| 9796 | key.clear(); |
| 9797 | } |
| 9798 | } |
| 9799 | } |
| 9800 | else |
| 9801 | { |
| 9802 | if (JSON_HEDLEY_UNLIKELY(!sax->start_object(std::size_t(-1)))) |
| 9803 | { |
| 9804 | return false; |
| 9805 | } |
| 9806 | |
| 9807 | while (current != '}') |
| 9808 | { |
| 9809 | if (JSON_HEDLEY_UNLIKELY(!get_ubjson_string(key, false) || !sax->key(key))) |
| 9810 | { |
nothing calls this directly
no test coverage detected