MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / get_ubjson_object

Method get_ubjson_object

Source/Utils/json.hpp:9752–9822  ·  view source on GitHub ↗

! @return whether object creation completed */

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

start_objectMethod · 0.45
keyMethod · 0.45
clearMethod · 0.45
end_objectMethod · 0.45

Tested by

no test coverage detected