| 7024 | */ |
| 7025 | template<typename NumberType> |
| 7026 | bool get_string(const input_format_t format, |
| 7027 | const NumberType len, |
| 7028 | string_t& result) |
| 7029 | { |
| 7030 | bool success = true; |
| 7031 | std::generate_n(std::back_inserter(result), len, [this, &success, &format]() |
| 7032 | { |
| 7033 | get(); |
| 7034 | if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(format, "string"))) |
| 7035 | { |
| 7036 | success = false; |
| 7037 | } |
| 7038 | return static_cast<char>(current); |
| 7039 | }); |
| 7040 | return success; |
| 7041 | } |
| 7042 | |
| 7043 | /*! |
| 7044 | @param[in] format the current format (for diagnostics) |
no test coverage detected