TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ unget()

template<typename BasicJsonType , typename InputAdapterType >
void nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::unget ( )
inlineprivate

unget current character (read it again on next get)

We implement unget by setting variable next_unget to true. The input is not changed - we just simulate ungetting by modifying chars_read_total, chars_read_current_line, and token_string. The next call to get() will behave as if the unget character is read again.

Definition at line 7979 of file json.hpp.

7980 {
7981 next_unget = true;
7983
7984 // in case we "unget" a newline, we have to also decrement the lines_read
7986 {
7987 if (position.lines_read > 0)
7988 {
7990 }
7991 }
7992
7993 else
7994 {
7996 }
7997
7998 if (JSON_HEDLEY_LIKELY(current != std::char_traits<char_type>::eof()))
7999 {
8000 JSON_ASSERT(!token_string.empty());
8001 token_string.pop_back();
8002 }
8003 }
bool next_unget
whether the next get() call should just return current
Definition: json.hpp:8222
char_int_type current
the current character
Definition: json.hpp:8219
position_t position
the start position of the current token
Definition: json.hpp:8225
std::vector< char_type > token_string
raw input token string (for error messages)
Definition: json.hpp:8228
std::size_t lines_read
the number of lines read
Definition: json.hpp:2598
std::size_t chars_read_current_line
the number of characters read in the current line
Definition: json.hpp:2596
std::size_t chars_read_total
the total number of characters read
Definition: json.hpp:2594