17 #ifndef RAPIDJSON_STREAM_H_
18 #define RAPIDJSON_STREAM_H_
20 #include "encodings.h"
22 RAPIDJSON_NAMESPACE_BEGIN
61 size_t PutEnd(Ch* begin);
72 template<
typename Stream>
79 enum { copyOptimization = 0 };
83 template<
typename Stream>
90 template<
typename Stream>
96 template<
typename Stream,
typename Ch>
99 for (
size_t i = 0; i < n; i++)
112 #if defined(_MSC_VER) && _MSC_VER <= 1800
114 RAPIDJSON_DIAG_OFF(4702)
115 RAPIDJSON_DIAG_OFF(4512)
118 template <
typename InputStream,
typename Encoding = UTF8<> >
121 typedef typename Encoding::Ch Ch;
124 Ch Peek()
const {
return is_.Peek(); }
125 Ch Take() {
return is_.Take(); }
126 size_t Tell() {
return is_.Tell(); }
127 Ch* PutBegin() {
return is_.PutBegin(); }
128 void Put(Ch ch) { is_.Put(ch); }
129 void Flush() { is_.Flush(); }
130 size_t PutEnd(Ch* ch) {
return is_.PutEnd(ch); }
133 const Ch* Peek4()
const {
return is_.Peek4(); }
136 UTFType GetType()
const {
return is_.GetType(); }
137 bool HasBOM()
const {
return is_.HasBOM(); }
143 #if defined(_MSC_VER) && _MSC_VER <= 1800
153 template <
typename Encoding>
155 typedef typename Encoding::Ch Ch;
159 Ch Peek()
const {
return *src_; }
160 Ch Take() {
return *src_++; }
161 size_t Tell()
const {
return static_cast<size_t>(src_ - head_); }
172 template <
typename Encoding>
174 enum { copyOptimization = 1 };
187 template <
typename Encoding>
189 typedef typename Encoding::Ch Ch;
194 Ch Peek() {
return *src_; }
195 Ch Take() {
return *src_++; }
196 size_t Tell() {
return static_cast<size_t>(src_ - head_); }
201 Ch* PutBegin() {
return dst_ = src_; }
202 size_t PutEnd(Ch* begin) {
return static_cast<size_t>(dst_ - begin); }
205 Ch* Push(
size_t count) { Ch* begin = dst_; dst_ += count;
return begin; }
206 void Pop(
size_t count) { dst_ -= count; }
213 template <
typename Encoding>
215 enum { copyOptimization = 1 };
221 RAPIDJSON_NAMESPACE_END
223 #endif // RAPIDJSON_STREAM_H_