template<typename BasicJsonType , typename InputAdapterType , typename SAX = json_sax_dom_parser<BasicJsonType>>
template<typename NumberType >
create a string by reading characters from the input
- Template Parameters
-
NumberType | the type of the number |
- Parameters
-
[in] | format | the current format (for diagnostics) |
[in] | len | number of characters to read |
[out] | result | string created by reading len bytes |
- Returns
- whether string creation completed
- Note
- We can not reserve len bytes for the result, because len may be too large. Usually, unexpect_eof() detects the end of the input before we run out of string memory.
Definition at line 10849 of file json.hpp.
10852 {
10853 bool success = true;
10854
10855 for (NumberType i = 0; i < len; i++)
10856 {
10858
10859 if (JSON_HEDLEY_UNLIKELY(!
unexpect_eof(format,
"string")))
10860 {
10861 success = false;
10862 break;
10863 }
10864
10865 result.push_back(
static_cast<typename string_t::value_type
>(
current));
10866 }
10867
10868 return success;
10869 }
bool unexpect_eof(const input_format_t format, const char *context) const
char_int_type current
the current character
char_int_type get()
get next character from the input