Class GenericStreamWrapper

Synopsis

#include <include/rapidjson/stream.h>

template <typename InputStream, typename Encoding = UTF8<> >
class GenericStreamWrapper

Description

A Stream Wrapper.

\tThis string stream is a wrapper for any stream by just forwarding any \treceived message to the origin stream.

Note
implements Stream concept

Methods

GenericStreamWrapper
Flush
GetType
HasBOM
Peek
Peek4
Put
PutBegin
PutEnd
Take
Tell

Source

Lines 118-141 in include/rapidjson/stream.h.

template <typename InputStream, typename Encoding = UTF8<> >
class GenericStreamWrapper {
public:
    typedef typename Encoding::Ch Ch;
    GenericStreamWrapper(InputStream& is): is_(is) {}

    Ch Peek() const { return is_.Peek(); }
    Ch Take() { return is_.Take(); }
    size_t Tell() { return is_.Tell(); }
    Ch* PutBegin() { return is_.PutBegin(); }
    void Put(Ch ch) { is_.Put(ch); }
    void Flush() { is_.Flush(); }
    size_t PutEnd(Ch* ch) { return is_.PutEnd(ch); }

    // wrapper for MemoryStream
    const Ch* Peek4() const { return is_.Peek4(); }

    // wrapper for AutoUTFInputStream
    UTFType GetType() const { return is_.GetType(); }
    bool HasBOM() const { return is_.HasBOM(); }

protected:
    InputStream& is_;
};





Add Discussion as Guest

Log in