15#ifndef RAPIDJSON_ISTREAMWRAPPER_H_
16#define RAPIDJSON_ISTREAMWRAPPER_H_
23RAPIDJSON_DIAG_OFF(padded)
24#elif defined(_MSC_VER)
26RAPIDJSON_DIAG_OFF(4351)
47template <
typename StreamType>
50 typedef typename StreamType::char_type
Ch;
54 typename StreamType::int_type c =
stream_.peek();
55 return RAPIDJSON_LIKELY(c != StreamType::traits_type::eof()) ?
static_cast<Ch>(c) :
static_cast<Ch>(
'\0');
59 typename StreamType::int_type c =
stream_.get();
62 return static_cast<Ch>(c);
80 bool hasError =
false;
81 for (i = 0; i < 4; ++i) {
82 typename StreamType::int_type c =
stream_.get();
83 if (c == StreamType::traits_type::eof()) {
90 for (--i; i >= 0; --i)
107#if defined(__clang__) || defined(_MSC_VER)
Wrapper of std::basic_istream into RapidJSON's Stream concept.
Definition istreamwrapper.h:48
std::istream & stream_
Definition istreamwrapper.h:99
Ch Peek() const
Definition istreamwrapper.h:53
Ch * PutBegin()
Definition istreamwrapper.h:71
BasicIStreamWrapper(const BasicIStreamWrapper &)
void Flush()
Definition istreamwrapper.h:73
BasicIStreamWrapper(StreamType &stream)
Definition istreamwrapper.h:51
const Ch * Peek4() const
Definition istreamwrapper.h:77
BasicIStreamWrapper & operator=(const BasicIStreamWrapper &)
StreamType::char_type Ch
Definition istreamwrapper.h:50
size_t PutEnd(Ch *)
Definition istreamwrapper.h:74
size_t count_
Definition istreamwrapper.h:100
size_t Tell() const
Definition istreamwrapper.h:69
Ch peekBuffer_[4]
Definition istreamwrapper.h:101
void Put(Ch)
Definition istreamwrapper.h:72
Ch Take()
Definition istreamwrapper.h:58
Definition readertest.cpp:1362
#define RAPIDJSON_LIKELY(x)
Compiler branching hint for expression with high probability to be true.
Definition rapidjson.h:468
#define RAPIDJSON_ASSERT(x)
Assertion.
Definition rapidjson.h:411
#define RAPIDJSON_NAMESPACE_BEGIN
provide custom rapidjson namespace (opening expression)
Definition rapidjson.h:121
#define RAPIDJSON_NAMESPACE_END
provide custom rapidjson namespace (closing expression)
Definition rapidjson.h:124
BasicIStreamWrapper< std::wistream > WIStreamWrapper
Definition istreamwrapper.h:105