Monero
Loading...
Searching...
No Matches
AutoUTFInputStream< CharType, InputByteStream > Class Template Reference

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

#include <encodedstream.h>

Public Types

typedef CharType Ch

Public Member Functions

 AutoUTFInputStream (InputByteStream &is, UTFType type=kUTF8)
 Constructor.
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.

Member Typedef Documentation

◆ Ch

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

◆ TakeFunc

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

Constructor & Destructor Documentation

◆ AutoUTFInputStream() [1/2]

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.

◆ AutoUTFInputStream() [2/2]

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

Member Function Documentation

◆ DetectType()

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

◆ Flush()

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

◆ GetType()

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

◆ HasBOM()

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

◆ operator=()

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

◆ Peek()

template<typename CharType, typename InputByteStream>
Ch AutoUTFInputStream< CharType, InputByteStream >::Peek ( ) const
inline

◆ Put()

template<typename CharType, typename InputByteStream>
void AutoUTFInputStream< CharType, InputByteStream >::Put ( Ch )
inline

◆ PutBegin()

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

◆ PutEnd()

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

◆ RAPIDJSON_STATIC_ASSERT()

template<typename CharType, typename InputByteStream>
AutoUTFInputStream< CharType, InputByteStream >::RAPIDJSON_STATIC_ASSERT ( sizeof(typename InputByteStream::Ch) = =1)
private

◆ Take()

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

◆ Tell()

template<typename CharType, typename InputByteStream>
size_t AutoUTFInputStream< CharType, InputByteStream >::Tell ( ) const
inline

Member Data Documentation

◆ current_

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

◆ hasBOM_

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

◆ is_

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

◆ takeFunc_

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

◆ type_

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

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