| 5396 | */ |
| 5397 | template<typename NumberType> |
| 5398 | bool get_string(const input_format_t format, |
| 5399 | const NumberType len, |
| 5400 | string_t& result) |
| 5401 | { |
| 5402 | bool success = true; |
| 5403 | std::generate_n(std::back_inserter(result), len, [this, &success, &format]() |
| 5404 | { |
| 5405 | get(); |
| 5406 | if (JSON_UNLIKELY(not unexpect_eof(format, "string"))) |
| 5407 | { |
| 5408 | success = false; |
| 5409 | } |
| 5410 | return static_cast<char>(current); |
| 5411 | }); |
| 5412 | return success; |
| 5413 | } |
| 5414 | |
| 5415 | /*! |
| 5416 | @param[in] format the current format (for diagnostics) |
no test coverage detected