| 6912 | */ |
| 6913 | template<typename NumberType> |
| 6914 | bool get_string(const input_format_t format, |
| 6915 | const NumberType len, |
| 6916 | string_t& result) |
| 6917 | { |
| 6918 | bool success = true; |
| 6919 | std::generate_n(std::back_inserter(result), len, [this, &success, &format]() |
| 6920 | { |
| 6921 | get(); |
| 6922 | if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(format, "string"))) |
| 6923 | { |
| 6924 | success = false; |
| 6925 | } |
| 6926 | return static_cast<char>(current); |
| 6927 | }); |
| 6928 | return success; |
| 6929 | } |
| 6930 | |
| 6931 | /*! |
| 6932 | @param[in] format the current format (for diagnostics) |
no test coverage detected