| 12006 | */ |
| 12007 | template<typename NumberType> |
| 12008 | bool get_binary(const input_format_t format, |
| 12009 | const NumberType len, |
| 12010 | binary_t& result) |
| 12011 | { |
| 12012 | bool success = true; |
| 12013 | for (NumberType i = 0; i < len; i++) |
| 12014 | { |
| 12015 | get(); |
| 12016 | if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(format, "binary"))) |
| 12017 | { |
| 12018 | success = false; |
| 12019 | break; |
| 12020 | } |
| 12021 | result.push_back(static_cast<std::uint8_t>(current)); |
| 12022 | } |
| 12023 | return success; |
| 12024 | } |
| 12025 | |
| 12026 | /*! |
| 12027 | @param[in] format the current format (for diagnostics) |