Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
EncodedInputStream< Encoding, InputByteStream > Class Template Reference

Input byte stream wrapper with a statically bound encoding. More...

#include <encodedstream.h>

Public Types

typedef Encoding::Ch Ch
 

Public Member Functions

 EncodedInputStream (InputByteStream &is)
 
Ch Peek () const
 
Ch Take ()
 
size_t Tell () const
 
void Put (Ch)
 
void Flush ()
 
ChPutBegin ()
 
size_t PutEnd (Ch *)
 

Private Member Functions

 RAPIDJSON_STATIC_ASSERT (sizeof(typename InputByteStream::Ch)==1)
 
 EncodedInputStream (const EncodedInputStream &)
 
EncodedInputStreamoperator= (const EncodedInputStream &)
 

Private Attributes

InputByteStream & is_
 
Ch current_
 

Detailed Description

template<typename Encoding, typename InputByteStream>
class EncodedInputStream< Encoding, InputByteStream >

Input byte stream wrapper with a statically bound encoding.

Template Parameters
EncodingThe interpretation of encoding of the stream. Either UTF8, UTF16LE, UTF16BE, UTF32LE, UTF32BE.
InputByteStreamType of input byte stream. For example, FileReadStream.

Definition at line 39 of file encodedstream.h.

Member Typedef Documentation

template<typename Encoding, typename InputByteStream>
typedef Encoding::Ch EncodedInputStream< Encoding, InputByteStream >::Ch

Definition at line 42 of file encodedstream.h.

Constructor & Destructor Documentation

template<typename Encoding, typename InputByteStream>
EncodedInputStream< Encoding, InputByteStream >::EncodedInputStream ( InputByteStream &  is)
inline

Definition at line 44 of file encodedstream.h.

44  : is_(is) {
45  current_ = Encoding::TakeBOM(is_);
46  }
InputByteStream & is_
Definition: encodedstream.h:62
template<typename Encoding, typename InputByteStream>
EncodedInputStream< Encoding, InputByteStream >::EncodedInputStream ( const EncodedInputStream< Encoding, InputByteStream > &  )
private

Member Function Documentation

template<typename Encoding, typename InputByteStream>
void EncodedInputStream< Encoding, InputByteStream >::Flush ( )
inline

Definition at line 54 of file encodedstream.h.

54 { RAPIDJSON_ASSERT(false); }
#define RAPIDJSON_ASSERT(x)
Assertion.
Definition: rapidjson.h:406
template<typename Encoding, typename InputByteStream>
EncodedInputStream& EncodedInputStream< Encoding, InputByteStream >::operator= ( const EncodedInputStream< Encoding, InputByteStream > &  )
private
template<typename Encoding, typename InputByteStream>
Ch EncodedInputStream< Encoding, InputByteStream >::Peek ( ) const
inline

Definition at line 48 of file encodedstream.h.

48 { return current_; }
template<typename Encoding, typename InputByteStream>
void EncodedInputStream< Encoding, InputByteStream >::Put ( Ch  )
inline

Definition at line 53 of file encodedstream.h.

53 { RAPIDJSON_ASSERT(false); }
#define RAPIDJSON_ASSERT(x)
Assertion.
Definition: rapidjson.h:406
template<typename Encoding, typename InputByteStream>
Ch* EncodedInputStream< Encoding, InputByteStream >::PutBegin ( )
inline

Definition at line 55 of file encodedstream.h.

55 { RAPIDJSON_ASSERT(false); return 0; }
#define RAPIDJSON_ASSERT(x)
Assertion.
Definition: rapidjson.h:406
template<typename Encoding, typename InputByteStream>
size_t EncodedInputStream< Encoding, InputByteStream >::PutEnd ( Ch )
inline

Definition at line 56 of file encodedstream.h.

56 { RAPIDJSON_ASSERT(false); return 0; }
#define RAPIDJSON_ASSERT(x)
Assertion.
Definition: rapidjson.h:406
template<typename Encoding, typename InputByteStream>
EncodedInputStream< Encoding, InputByteStream >::RAPIDJSON_STATIC_ASSERT ( sizeof(typename InputByteStream::Ch)  = =1)
private
template<typename Encoding, typename InputByteStream>
Ch EncodedInputStream< Encoding, InputByteStream >::Take ( )
inline

Definition at line 49 of file encodedstream.h.

49 { Ch c = current_; current_ = Encoding::Take(is_); return c; }
Encoding::Ch Ch
Definition: encodedstream.h:42
InputByteStream & is_
Definition: encodedstream.h:62
template<typename Encoding, typename InputByteStream>
size_t EncodedInputStream< Encoding, InputByteStream >::Tell ( ) const
inline

Definition at line 50 of file encodedstream.h.

50 { return is_.Tell(); }
InputByteStream & is_
Definition: encodedstream.h:62

Member Data Documentation

template<typename Encoding, typename InputByteStream>
Ch EncodedInputStream< Encoding, InputByteStream >::current_
private

Definition at line 63 of file encodedstream.h.

template<typename Encoding, typename InputByteStream>
InputByteStream& EncodedInputStream< Encoding, InputByteStream >::is_
private

Definition at line 62 of file encodedstream.h.


The documentation for this class was generated from the following file: