The same binary layout is used for objects and arrays, hence it must be indicated with the argument is_array which one is expected (true --> array, false --> object).
8726 {
8728
8729 while (
auto element_type =
get())
8730 {
8731 if (JSON_HEDLEY_UNLIKELY(!
unexpect_eof(input_format_t::bson,
"element list")))
8732 {
8733 return false;
8734 }
8735
8736 const std::size_t element_type_parse_position =
chars_read;
8737
8739 {
8740 return false;
8741 }
8742
8743 if (!is_array && !
sax->key(key))
8744 {
8745 return false;
8746 }
8747
8749 {
8750 return false;
8751 }
8752
8753
8755 }
8756
8757 return true;
8758 }
bool parse_bson_element_internal(const char_int_type element_type, const std::size_t element_type_parse_position)
Read a BSON document element of the given element_type.
bool get_bson_cstr(string_t &result)
Parses a C-style string from the BSON input.
bool unexpect_eof(const input_format_t format, const char *context) const
std::size_t chars_read
the number of characters read
json_sax_t * sax
the SAX parser
char_int_type get()
get next character from the input
@ key
the parser read a key of a value in an object