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] | ranges | list 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);
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 {
6812 }
6813
6814 else
6815 {
6817 return false;
6818 }
6819 }
6820
6821 return true;
6822 }
void add(char_int_type c)
add a character to token_buffer
char_int_type current
the current character
const char * error_message
a description of occurred lexer errors