TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ get_string()

template<typename BasicJsonType , typename InputAdapterType , typename SAX = json_sax_dom_parser<BasicJsonType>>
template<typename NumberType >
bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_string ( const input_format_t  format,
const NumberType  len,
string_t &  result 
)
inlineprivate

create a string by reading characters from the input

Template Parameters
NumberTypethe type of the number
Parameters
[in]formatthe current format (for diagnostics)
[in]lennumber of characters to read
[out]resultstring 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 {
10857 get();
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
Definition: json.hpp:10914
char_int_type current
the current character
Definition: json.hpp:10978
char_int_type get()
get next character from the input
Definition: json.hpp:10769