MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / get_character

Method get_character

Source/Utils/json.hpp:4823–4832  ·  view source on GitHub ↗

std::istream/std::streambuf use std::char_traits ::to_int_type, to ensure that std::char_traits ::eof() and the character 0xFF do not end up as the same value, eg. 0xFFFFFFFF.

Source from the content-addressed store, hash-verified

4821 // ensure that std::char_traits<char>::eof() and the character 0xFF do not
4822 // end up as the same value, eg. 0xFFFFFFFF.
4823 std::char_traits<char>::int_type get_character()
4824 {
4825 auto res = sb->sbumpc();
4826 // set eof manually, as we don't use the istream interface.
4827 if (JSON_HEDLEY_UNLIKELY(res == EOF))
4828 {
4829 is->clear(is->rdstate() | std::ios::eofbit);
4830 }
4831 return res;
4832 }
4833
4834 private:
4835 /// the associated input stream

Callers

nothing calls this directly

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected