17 #ifndef RAPIDJSON_STREAM_H_ 18 #define RAPIDJSON_STREAM_H_ 72 template<
typename Stream>
83 template<
typename Stream>
90 template<
typename Stream>
91 inline void PutUnsafe(Stream& stream,
typename Stream::Ch c) {
96 template<
typename Stream,
typename Ch>
97 inline void PutN(Stream& stream, Ch c,
size_t n) {
99 for (
size_t i = 0; i < n; i++)
109 template <
typename Encoding>
111 typedef typename Encoding::Ch
Ch;
115 Ch
Peek()
const {
return *src_; }
117 size_t Tell()
const {
return static_cast<size_t>(src_ - head_); }
128 template <
typename Encoding>
143 template <
typename Encoding>
145 typedef typename Encoding::Ch
Ch;
152 size_t Tell() {
return static_cast<size_t>(src_ - head_); }
158 size_t PutEnd(Ch* begin) {
return static_cast<size_t>(dst_ - begin); }
161 Ch*
Push(
size_t count) { Ch* begin = dst_; dst_ += count;
return begin; }
162 void Pop(
size_t count) { dst_ -= count; }
169 template <
typename Encoding>
179 #endif // RAPIDJSON_STREAM_H_ GenericStringStream< UTF8<> > StringStream
String stream with UTF8 encoding.
GenericInsituStringStream< UTF8<> > InsituStringStream
Insitu string stream with UTF8 encoding.
#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)
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
const Ch * head_
Original head of the string.