| 9299 | */ |
| 9300 | template<typename NumberType> |
| 9301 | bool get_bson_string(const NumberType len, string_t& result) |
| 9302 | { |
| 9303 | if (JSON_HEDLEY_UNLIKELY(len < 1)) |
| 9304 | { |
| 9305 | auto last_token = get_token_string(); |
| 9306 | return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, |
| 9307 | exception_message(input_format_t::bson, concat("string length must be at least 1, is ", std::to_string(len)), "string"), nullptr)); |
| 9308 | } |
| 9309 | |
| 9310 | return get_string(input_format_t::bson, len - static_cast<NumberType>(1), result) && get() != std::char_traits<char_type>::eof(); |
| 9311 | } |
| 9312 | |
| 9313 | /*! |
| 9314 | @brief Parses a byte array input of length @a len from the BSON input. |
nothing calls this directly
no test coverage detected