NGL  6.5
The NCCA Graphics Library
AutoUTFInputStream< CharType, InputByteStream > Class Template Reference

Input stream wrapper with dynamically bound encoding and automatic encoding detection. More...

#include <encodedstream.h>

+ Collaboration diagram for AutoUTFInputStream< CharType, InputByteStream >:

Public Types

typedef CharType Ch
 

Public Member Functions

 AutoUTFInputStream (InputByteStream &is, UTFType type=kUTF8)
 Constructor. More...
 
UTFType GetType () const
 
bool HasBOM () const
 
Ch Peek () const
 
Ch Take ()
 
size_t Tell () const
 
void Put (Ch)
 
void Flush ()
 
ChPutBegin ()
 
size_t PutEnd (Ch *)
 

Private Types

typedef Ch(* TakeFunc) (InputByteStream &is)
 

Private Member Functions

 RAPIDJSON_STATIC_ASSERT (sizeof(typename InputByteStream::Ch)==1)
 
 AutoUTFInputStream (const AutoUTFInputStream &)
 
AutoUTFInputStreamoperator= (const AutoUTFInputStream &)
 
void DetectType ()
 

Private Attributes

InputByteStream * is_
 
UTFType type_
 
Ch current_
 
TakeFunc takeFunc_
 
bool hasBOM_
 

Detailed Description

template<typename CharType, typename InputByteStream>
class AutoUTFInputStream< CharType, InputByteStream >

Input stream wrapper with dynamically bound encoding and automatic encoding detection.

Template Parameters
CharTypeType of character for reading.
InputByteStreamtype of input byte stream to be wrapped.

Definition at line 101 of file encodedstream.h.

Member Typedef Documentation

template<typename CharType , typename InputByteStream >
typedef CharType AutoUTFInputStream< CharType, InputByteStream >::Ch

Definition at line 104 of file encodedstream.h.

template<typename CharType , typename InputByteStream >
typedef Ch(* AutoUTFInputStream< CharType, InputByteStream >::TakeFunc) (InputByteStream &is)
private

Definition at line 185 of file encodedstream.h.

Constructor & Destructor Documentation

template<typename CharType , typename InputByteStream >
AutoUTFInputStream< CharType, InputByteStream >::AutoUTFInputStream ( InputByteStream &  is,
UTFType  type = kUTF8 
)
inline

Constructor.

Parameters
isinput stream to be wrapped.
typeUTF encoding type if it is not detected from the stream.

Definition at line 111 of file encodedstream.h.

References EncodedInputStream< Encoding, InputByteStream >::current_, EncodedInputStream< Encoding, InputByteStream >::is_, kUTF32BE, kUTF8, RAPIDJSON_ASSERT, RAPIDJSON_ENCODINGS_FUNC, and EncodedInputStream< Encoding, InputByteStream >::Take().

+ Here is the call graph for this function:

template<typename CharType , typename InputByteStream >
AutoUTFInputStream< CharType, InputByteStream >::AutoUTFInputStream ( const AutoUTFInputStream< CharType, InputByteStream > &  )
private

Member Function Documentation

template<typename CharType , typename InputByteStream >
void AutoUTFInputStream< CharType, InputByteStream >::DetectType ( )
inlineprivate
template<typename CharType , typename InputByteStream >
void AutoUTFInputStream< CharType, InputByteStream >::Flush ( )
inline

Definition at line 128 of file encodedstream.h.

References RAPIDJSON_ASSERT.

template<typename CharType , typename InputByteStream >
UTFType AutoUTFInputStream< CharType, InputByteStream >::GetType ( ) const
inline

Definition at line 119 of file encodedstream.h.

template<typename CharType , typename InputByteStream >
bool AutoUTFInputStream< CharType, InputByteStream >::HasBOM ( ) const
inline

Definition at line 120 of file encodedstream.h.

template<typename CharType , typename InputByteStream >
AutoUTFInputStream& AutoUTFInputStream< CharType, InputByteStream >::operator= ( const AutoUTFInputStream< CharType, InputByteStream > &  )
private
template<typename CharType , typename InputByteStream >
Ch AutoUTFInputStream< CharType, InputByteStream >::Peek ( ) const
inline
template<typename CharType , typename InputByteStream >
void AutoUTFInputStream< CharType, InputByteStream >::Put ( Ch  )
inline

Definition at line 127 of file encodedstream.h.

References RAPIDJSON_ASSERT.

template<typename CharType , typename InputByteStream >
Ch* AutoUTFInputStream< CharType, InputByteStream >::PutBegin ( )
inline

Definition at line 129 of file encodedstream.h.

References RAPIDJSON_ASSERT.

template<typename CharType , typename InputByteStream >
size_t AutoUTFInputStream< CharType, InputByteStream >::PutEnd ( Ch )
inline

Definition at line 130 of file encodedstream.h.

References EncodedInputStream< Encoding, InputByteStream >::operator=(), and RAPIDJSON_ASSERT.

+ Here is the call graph for this function:

template<typename CharType , typename InputByteStream >
AutoUTFInputStream< CharType, InputByteStream >::RAPIDJSON_STATIC_ASSERT ( sizeof(typename InputByteStream::Ch)  = =1)
private
template<typename CharType , typename InputByteStream >
Ch AutoUTFInputStream< CharType, InputByteStream >::Take ( )
inline
template<typename CharType , typename InputByteStream >
size_t AutoUTFInputStream< CharType, InputByteStream >::Tell ( ) const
inline

Member Data Documentation

template<typename CharType , typename InputByteStream >
Ch AutoUTFInputStream< CharType, InputByteStream >::current_
private

Definition at line 188 of file encodedstream.h.

template<typename CharType , typename InputByteStream >
bool AutoUTFInputStream< CharType, InputByteStream >::hasBOM_
private

Definition at line 190 of file encodedstream.h.

template<typename CharType , typename InputByteStream >
InputByteStream* AutoUTFInputStream< CharType, InputByteStream >::is_
private

Definition at line 186 of file encodedstream.h.

template<typename CharType , typename InputByteStream >
TakeFunc AutoUTFInputStream< CharType, InputByteStream >::takeFunc_
private

Definition at line 189 of file encodedstream.h.

template<typename CharType , typename InputByteStream >
UTFType AutoUTFInputStream< CharType, InputByteStream >::type_
private

Definition at line 187 of file encodedstream.h.


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