Go to the SVN repository for this file.
15 #ifndef RAPIDJSON_ISTREAMWRAPPER_H_ 16 #define RAPIDJSON_ISTREAMWRAPPER_H_ 23RAPIDJSON_DIAG_OFF(padded)
28RAPIDJSON_DIAG_OFF(4351)
49 template<
typenameStreamType>
56: stream_(stream), count_(), peekBuffer_(),
57bufferSize_(bufferSize),
buffer(new
Ch[bufferSize_])
59bufferLast_ = current_ =
buffer.get();
61pos_ = stream_.tellg();
67stream_.seekg(pos_ + count_);
82 typenameStreamType::int_type c = stream_.peek();
83 return RAPIDJSON_LIKELY(c != StreamType::traits_type::eof()) ?
static_cast<Ch
>(c) :
static_cast<Ch
>(
'\0');
87 typenameStreamType::int_type c = stream_.get();
90 return static_cast<Ch
>(c);
98 size_t Tell()
const{
returncount_; }
109 boolhasError =
false;
110 for(
i= 0;
i< 4; ++
i) {
111 typenameStreamType::int_type c = stream_.get();
112 if(c == StreamType::traits_type::eof()) {
117peekBuffer_[
i] =
static_cast<Ch>(c);
119 for(--
i;
i>= 0; --
i)
120stream_.putback(peekBuffer_[
i]);
121 return!hasError ? peekBuffer_ : 0;
130 mutable ChpeekBuffer_[4];
141 if(current_ < bufferLast_) {
145 if(!eof_ && current_ == bufferLast_) {
147stream_.read(current_, bufferSize_);
148bufferLast_ = current_ + stream_.gcount();
149 if(current_ == bufferLast_) {
161 #if defined(__clang__) || defined(_MSC_VER)Wrapper of std::basic_istream into RapidJSON's Stream concept.
BasicIStreamWrapper(const BasicIStreamWrapper &)
BasicIStreamWrapper & operator=(const BasicIStreamWrapper &)
std::unique_ptr< Ch[]> buffer
size_t count_
Number of characters read. Note:
BasicIStreamWrapper(StreamType &stream, size_t bufferSize=16 *1024)
void Read(CObjectIStream &in, TObjectPtr object, const CTypeRef &type)
#define RAPIDJSON_LIKELY(x)
Compiler branching hint for expression with high probability to be true.
#define RAPIDJSON_ASSERT(x)
Assertion.
#define RAPIDJSON_NAMESPACE_BEGIN
provide custom rapidjson namespace (opening expression)
#define RAPIDJSON_NAMESPACE_END
provide custom rapidjson namespace (closing expression)
string_type::value_type char_type
The character type used by the parser.
BasicIStreamWrapper< std::istream > IStreamWrapper
BasicIStreamWrapper< std::wistream > WIStreamWrapper
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4