Struct GenericStringStream

Synopsis

#include <include/rapidjson/stream.h>

template <typename Encoding>
struct GenericStringStream

Description

Read-only string stream.

Note
implements Stream concept

Mentioned in

Methods

GenericStringStream
Flush
Peek
Put
PutBegin
PutEnd
Take
Tell

Source

Lines 153-170 in include/rapidjson/stream.h.

template <typename Encoding>
struct GenericStringStream {
    typedef typename Encoding::Ch Ch;

    GenericStringStream(const Ch *src) : src_(src), head_(src) {}

    Ch Peek() const { return *src_; }
    Ch Take() { return *src_++; }
    size_t Tell() const { return static_cast<size_t>(src_ - head_); }

    Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
    void Put(Ch) { RAPIDJSON_ASSERT(false); }
    void Flush() { RAPIDJSON_ASSERT(false); }
    size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }

    const Ch* src_;     //!< Current read position.
    const Ch* head_;    //!< Original head of the string.
};





Add Discussion as Guest

Log in