Class EncodedInputStream< UTF8<>, MemoryStream >

Synopsis

#include <include/rapidjson/encodedstream.h>

template <>
class EncodedInputStream<UTF8<>, MemoryStream>

Description

Specialized for UTF8 MemoryStream.

Methods

EncodedInputStream
Flush
Peek
Put
PutBegin
PutEnd
Take
Tell

Source

Lines 67-92 in include/rapidjson/encodedstream.h.

template <>
class EncodedInputStream<UTF8<>, MemoryStream> {
public:
    typedef UTF8<>::Ch Ch;

    EncodedInputStream(MemoryStream& is) : is_(is) {
        if (static_cast<unsigned char>(is_.Peek()) == 0xEFu) is_.Take();
        if (static_cast<unsigned char>(is_.Peek()) == 0xBBu) is_.Take();
        if (static_cast<unsigned char>(is_.Peek()) == 0xBFu) is_.Take();
    }
    Ch Peek() const { return is_.Peek(); }
    Ch Take() { return is_.Take(); }
    size_t Tell() const { return is_.Tell(); }

    // Not implemented
    void Put(Ch) {}
    void Flush() {} 
    Ch* PutBegin() { return 0; }
    size_t PutEnd(Ch*) { return 0; }

    MemoryStream& is_;

private:
    EncodedInputStream(const EncodedInputStream&);
    EncodedInputStream& operator=(const EncodedInputStream&);
};





Add Discussion as Guest

Log in