17 #ifndef RAPIDJSON_STREAM_H_ 18 #define RAPIDJSON_STREAM_H_ 61 size_t PutEnd(Ch* begin);
72 template<
typename Stream>
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(); }
128 void Put(Ch ch) { is_.Put(ch); }
130 size_t PutEnd(Ch* ch) {
return is_.PutEnd(ch); }
133 const Ch*
Peek4()
const {
return is_.Peek4(); }
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_; }
161 size_t Tell()
const {
return static_cast<size_t>(src_ - head_); }
172 template <
typename Encoding>
187 template <
typename Encoding>
189 typedef typename Encoding::Ch
Ch;
196 size_t Tell() {
return static_cast<size_t>(src_ - head_); }
206 void Pop(
size_t count) { dst_ -= count; }
213 template <
typename Encoding>
223 #endif // RAPIDJSON_STREAM_H_ GenericStringStream< UTF8<> > StringStream
String stream with UTF8 encoding.
GenericInsituStringStream< UTF8<> > InsituStringStream
Insitu string stream with UTF8 encoding.
UTFType
Runtime-specified UTF encoding type of a stream.
#define RAPIDJSON_ASSERT(x)
Assertion.
#define RAPIDJSON_NAMESPACE_END
provide custom rapidjson namespace (closing expression)
GenericInsituStringStream(Ch *src)
const Ch * src_
Current read position.
#define RAPIDJSON_NAMESPACE_BEGIN
provide custom rapidjson namespace (opening expression)
A read-write string stream.
GenericStringStream(const Ch *src)
GenericStreamWrapper(InputStream &is)
void PutUnsafe(Stream &stream, typename Stream::Ch c)
Write character to a stream, presuming buffer is reserved.
void PutReserve(Stream &stream, size_t count)
Reserve n characters for writing to a stream.
Provides additional information for stream.
void PutN(Stream &stream, Ch c, size_t n)
Put N copies of a character to a stream.
common definitions and configuration
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
const Ch * head_
Original head of the string.