NGL  6.5
The NCCA Graphics Library
AutoUTFOutputStream< CharType, OutputByteStream > Class Template Reference

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

#include <encodedstream.h>

+ Collaboration diagram for AutoUTFOutputStream< CharType, OutputByteStream >:

Public Types

typedef CharType Ch
 

Public Member Functions

 AutoUTFOutputStream (OutputByteStream &os, UTFType type, bool putBOM)
 Constructor. More...
 
UTFType GetType () const
 
void Put (Ch c)
 
void Flush ()
 
Ch Peek () const
 
Ch Take ()
 
size_t Tell () const
 
ChPutBegin ()
 
size_t PutEnd (Ch *)
 

Private Types

typedef void(* PutFunc) (OutputByteStream &, Ch)
 

Private Member Functions

 RAPIDJSON_STATIC_ASSERT (sizeof(typename OutputByteStream::Ch)==1)
 
 AutoUTFOutputStream (const AutoUTFOutputStream &)
 
AutoUTFOutputStreamoperator= (const AutoUTFOutputStream &)
 
void PutBOM ()
 

Private Attributes

OutputByteStream * os_
 
UTFType type_
 
PutFunc putFunc_
 

Detailed Description

template<typename CharType, typename OutputByteStream>
class AutoUTFOutputStream< CharType, OutputByteStream >

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

Template Parameters
CharTypeType of character for writing.
InputByteStreamtype of output byte stream to be wrapped.

Definition at line 199 of file encodedstream.h.

Member Typedef Documentation

template<typename CharType , typename OutputByteStream >
typedef CharType AutoUTFOutputStream< CharType, OutputByteStream >::Ch

Definition at line 202 of file encodedstream.h.

template<typename CharType , typename OutputByteStream >
typedef void(* AutoUTFOutputStream< CharType, OutputByteStream >::PutFunc) (OutputByteStream &, Ch)
private

Definition at line 246 of file encodedstream.h.

Constructor & Destructor Documentation

template<typename CharType , typename OutputByteStream >
AutoUTFOutputStream< CharType, OutputByteStream >::AutoUTFOutputStream ( OutputByteStream &  os,
UTFType  type,
bool  putBOM 
)
inline

Constructor.

Parameters
osoutput stream to be wrapped.
typeUTF encoding type.
putBOMWhether to write BOM at the beginning of the stream.

Definition at line 210 of file encodedstream.h.

References kUTF16BE, kUTF16LE, kUTF32BE, kUTF32LE, kUTF8, EncodedInputStream< Encoding, InputByteStream >::Put(), RAPIDJSON_ASSERT, and RAPIDJSON_ENCODINGS_FUNC.

+ Here is the call graph for this function:

template<typename CharType , typename OutputByteStream >
AutoUTFOutputStream< CharType, OutputByteStream >::AutoUTFOutputStream ( const AutoUTFOutputStream< CharType, OutputByteStream > &  )
private

Member Function Documentation

template<typename CharType , typename OutputByteStream >
void AutoUTFOutputStream< CharType, OutputByteStream >::Flush ( )
inline

Definition at line 227 of file encodedstream.h.

template<typename CharType , typename OutputByteStream >
UTFType AutoUTFOutputStream< CharType, OutputByteStream >::GetType ( ) const
inline

Definition at line 224 of file encodedstream.h.

template<typename CharType , typename OutputByteStream >
AutoUTFOutputStream& AutoUTFOutputStream< CharType, OutputByteStream >::operator= ( const AutoUTFOutputStream< CharType, OutputByteStream > &  )
private
template<typename CharType , typename OutputByteStream >
Ch AutoUTFOutputStream< CharType, OutputByteStream >::Peek ( ) const
inline

Definition at line 230 of file encodedstream.h.

References RAPIDJSON_ASSERT.

template<typename CharType , typename OutputByteStream >
void AutoUTFOutputStream< CharType, OutputByteStream >::Put ( Ch  c)
inline

Definition at line 226 of file encodedstream.h.

template<typename CharType , typename OutputByteStream >
Ch* AutoUTFOutputStream< CharType, OutputByteStream >::PutBegin ( )
inline

Definition at line 233 of file encodedstream.h.

References RAPIDJSON_ASSERT.

template<typename CharType , typename OutputByteStream >
void AutoUTFOutputStream< CharType, OutputByteStream >::PutBOM ( )
inlineprivate

Definition at line 240 of file encodedstream.h.

References RAPIDJSON_ENCODINGS_FUNC, and void().

+ Here is the call graph for this function:

template<typename CharType , typename OutputByteStream >
size_t AutoUTFOutputStream< CharType, OutputByteStream >::PutEnd ( Ch )
inline

Definition at line 234 of file encodedstream.h.

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

+ Here is the call graph for this function:

template<typename CharType , typename OutputByteStream >
AutoUTFOutputStream< CharType, OutputByteStream >::RAPIDJSON_STATIC_ASSERT ( sizeof(typename OutputByteStream::Ch)  = =1)
private
template<typename CharType , typename OutputByteStream >
Ch AutoUTFOutputStream< CharType, OutputByteStream >::Take ( )
inline

Definition at line 231 of file encodedstream.h.

References RAPIDJSON_ASSERT.

template<typename CharType , typename OutputByteStream >
size_t AutoUTFOutputStream< CharType, OutputByteStream >::Tell ( ) const
inline

Definition at line 232 of file encodedstream.h.

References RAPIDJSON_ASSERT.

Member Data Documentation

template<typename CharType , typename OutputByteStream >
OutputByteStream* AutoUTFOutputStream< CharType, OutputByteStream >::os_
private

Definition at line 248 of file encodedstream.h.

template<typename CharType , typename OutputByteStream >
PutFunc AutoUTFOutputStream< CharType, OutputByteStream >::putFunc_
private

Definition at line 250 of file encodedstream.h.

template<typename CharType , typename OutputByteStream >
UTFType AutoUTFOutputStream< CharType, OutputByteStream >::type_
private

Definition at line 249 of file encodedstream.h.


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