MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / unget

Function unget

dependencies/json/json.hpp:7313–7337  ·  view source on GitHub ↗

! @brief 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. */

Source from the content-addressed store, hash-verified

7311 behave as if the unget character is read again.
7312 */
7313 void unget()
7314 {
7315 next_unget = true;
7316
7317 --position.chars_read_total;
7318
7319 // in case we "unget" a newline, we have to also decrement the lines_read
7320 if (position.chars_read_current_line == 0)
7321 {
7322 if (position.lines_read > 0)
7323 {
7324 --position.lines_read;
7325 }
7326 }
7327 else
7328 {
7329 --position.chars_read_current_line;
7330 }
7331
7332 if (JSON_HEDLEY_LIKELY(current != std::char_traits<char_type>::eof()))
7333 {
7334 JSON_ASSERT(!token_string.empty());
7335 token_string.pop_back();
7336 }
7337 }
7338
7339 /// add a character to token_buffer
7340 void add(char_int_type c)

Callers 3

scan_commentMethod · 0.70
scan_numberMethod · 0.70
skip_bomFunction · 0.70

Calls 2

emptyMethod · 0.45
pop_backMethod · 0.45

Tested by

no test coverage detected