TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ next_byte_in_range()

template<typename BasicJsonType , typename InputAdapterType >
bool nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::next_byte_in_range ( std::initializer_list< char_int_type >  ranges)
inlineprivate

check if the next byte(s) are inside a given range

Adds the current byte and, for each passed range, reads a new byte and checks if it is inside the range. If a violation was detected, set up an error message and return false. Otherwise, return true.

Parameters
[in]rangeslist of integers; interpreted as list of pairs of inclusive lower and upper bound, respectively
Precondition
The passed list ranges must have 2, 4, or 6 elements; that is, 1, 2, or 3 pairs. This precondition is enforced by an assertion.
Returns
true if and only if no range violation was detected

Definition at line 6800 of file json.hpp.

6801 {
6802 JSON_ASSERT(ranges.size() == 2 || ranges.size() == 4 || ranges.size() == 6);
6803 add(current);
6804
6805 for (auto range = ranges.begin(); range != ranges.end(); ++range)
6806 {
6807 get();
6808
6809 if (JSON_HEDLEY_LIKELY(*range <= current && current <= *(++range)))
6810 {
6811 add(current);
6812 }
6813
6814 else
6815 {
6816 error_message = "invalid string: ill-formed UTF-8 byte";
6817 return false;
6818 }
6819 }
6820
6821 return true;
6822 }
void add(char_int_type c)
add a character to token_buffer
Definition: json.hpp:8006
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