libcommonc++  0.7
UTFDecoder Class Referenceabstract

A base class for transcoders that decode strings to UTF-16 from a different UTF encoding. More...

#include <UTFDecoder.h++>

Inheritance diagram for UTFDecoder:

Public Member Functions

virtual void reset ()=0
 Resets the decoder to an initial state. More...
 
virtual ~UTFDecoder ()
 Destructor. More...
 

Static Public Attributes

static const int STATUS_OK = 0
 A status indicating that all input has been successfully transcoded. More...
 
static const int STATUS_NEED_MORE_INPUT = -1
 A status indicating that more input must be supplied to complete the transcoding. More...
 
static const int STATUS_OUTPUT_BUFFER_FULL = -2
 A status indicating that there is not enough room in the output buffer to finish transcoding the input buffer. More...
 
static const int STATUS_INVALID_INPUT = -3
 A status indicating that transcoding cannot continue because invalid data was encountered in the input buffer. More...
 

Protected Member Functions

 UTFDecoder ()
 Constructor. More...
 
int outputChar (char32_t char32, char16_t **buf, int *length)
 Outputs a UTF-32 character as a single UTF-16 character or surrogate pair. More...
 

Detailed Description

A base class for transcoders that decode strings to UTF-16 from a different UTF encoding.

Constructor & Destructor Documentation

◆ ~UTFDecoder()

~UTFDecoder ( )
virtual

Destructor.

◆ UTFDecoder()

UTFDecoder ( )
protected

Constructor.

Member Function Documentation

◆ outputChar()

int outputChar ( char32_t  char32,
char16_t **  buf,
int *  length 
)
protected

Outputs a UTF-32 character as a single UTF-16 character or surrogate pair.

Parameters
char32The character to output.
bufThe output buffer.
lengthThe remaining number of elements in the output buffer.
Returns
A status code.

◆ reset()

virtual void reset ( )
pure virtual

Resets the decoder to an initial state.

Implemented in UTF8Decoder, and UTF32Decoder.

Member Data Documentation

◆ STATUS_INVALID_INPUT

const int STATUS_INVALID_INPUT = -3
static

A status indicating that transcoding cannot continue because invalid data was encountered in the input buffer.

◆ STATUS_NEED_MORE_INPUT

const int STATUS_NEED_MORE_INPUT = -1
static

A status indicating that more input must be supplied to complete the transcoding.

◆ STATUS_OK

const int STATUS_OK = 0
static

A status indicating that all input has been successfully transcoded.

◆ STATUS_OUTPUT_BUFFER_FULL

const int STATUS_OUTPUT_BUFFER_FULL = -2
static

A status indicating that there is not enough room in the output buffer to finish transcoding the input buffer.


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