| 5337 | */ |
| 5338 | template<typename NumberType> |
| 5339 | bool get_bson_string(const NumberType len, string_t& result) |
| 5340 | { |
| 5341 | if (JSON_HEDLEY_UNLIKELY(len < 1)) |
| 5342 | { |
| 5343 | auto last_token = get_token_string(); |
| 5344 | return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::bson, "string length must be at least 1, is " + std::to_string(len), "string"))); |
| 5345 | } |
| 5346 | |
| 5347 | return get_string(input_format_t::bson, len - static_cast<NumberType>(1), result) and get() != std::char_traits<char>::eof(); |
| 5348 | } |
| 5349 | |
| 5350 | /*! |
| 5351 | @brief Read a BSON document element of the given @a element_type. |
nothing calls this directly
no test coverage detected