TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ scan_literal()

template<typename BasicJsonType , typename InputAdapterType >
token_type nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::scan_literal ( const char_type *  literal_text,
const std::size_t  length,
token_type  return_type 
)
inlineprivate
Parameters
[in]literal_textthe literal text to expect
[in]lengththe length of the passed literal text
[in]return_typethe token type to return on success

Definition at line 7902 of file json.hpp.

7904 {
7905 JSON_ASSERT(std::char_traits<char_type>::to_char_type(current) == literal_text[0]);
7906
7907 for (std::size_t i = 1; i < length; ++i)
7908 {
7909 if (JSON_HEDLEY_UNLIKELY(std::char_traits<char_type>::to_char_type(get()) != literal_text[i]))
7910 {
7911 error_message = "invalid literal";
7912 return token_type::parse_error;
7913 }
7914 }
7915
7916 return return_type;
7917 }
char_int_type current
the current character
Definition: json.hpp:8219
const char * error_message
a description of occurred lexer errors
Definition: json.hpp:8234