Falcon::TranscoderUTF16 Class Reference

UTF-16 encoding transcoder. More...

#include <transcoding.h>

Inheritance diagram for Falcon::TranscoderUTF16:

Inheritance graph

List of all members.

Public Types

Public Member Functions

virtual FalconDataclone () const
 Clones the stream.
virtual const String encoding () const
 Returns the character encoding which is managed by this transcoder.
t_endianity endianity () const
virtual bool get (uint32 &chr)
 Gets next character from the stream.
virtual bool put (uint32 chr)
 Writes a character on the stream.
 TranscoderUTF16 (const TranscoderUTF16 &other)
 TranscoderUTF16 (Stream *s, bool bOwn=false, t_endianity endianity=e_detect)
 Constructor UTF-16 requires specification of endianity with a prefix character.

Protected Attributes

bool m_bom

Detailed Description

UTF-16 encoding transcoder.

Member Enumeration Documentation

Endianity specification, see the constructor.


Constructor & Destructor Documentation

Falcon::TranscoderUTF16::TranscoderUTF16 ( Stream s,
bool  bOwn = false,
t_endianity  endianity = e_detect 

Constructor UTF-16 requires specification of endianity with a prefix character.

On output transcoding, this character is written right before the first write() is performed, while on input it is read right before the first get() is performed.

This constructor allows to select an endianity used in I/O. The default is e_none; in this case, the transcoder will detect and use the system endianity on output.

In input, the marker read at first get() determines the endianity. If the marker can't be found (i.e. if the stream was not at beginning), the supplied parameter will be used.

If the endianity is e_detect, the host system endianity is used.

The method endianity() can be used to determine the endianity of the stream in input that was decided either by reading the marker or by the constructor.

s the underlying stream
bOwn own the underlying stream
endianity the endianity for operations.

Falcon::TranscoderUTF16::TranscoderUTF16 ( const TranscoderUTF16 other  ) 

Member Function Documentation

virtual FalconData* Falcon::TranscoderUTF16::clone (  )  const [virtual]

Clones the stream.

This version returns 0 and sets error to unsupported; subclasses must properly clone the stream.

Reimplemented from Falcon::Stream.

virtual const String Falcon::TranscoderUTF16::encoding (  )  const [inline, virtual]

Returns the character encoding which is managed by this transcoder.

Subclasses must reimplement this to return the name of the supported encoding.

Implements Falcon::Transcoder.

t_endianity Falcon::TranscoderUTF16::endianity (  )  const [inline]

virtual bool Falcon::TranscoderUTF16::get ( uint32 chr  )  [virtual]

Gets next character from the stream.

Subclasses must manage both stateful transcoding and properly popping readahead characters from the buffer.

true if the character is available, false on stream end or error.

Implements Falcon::Stream.

virtual bool Falcon::TranscoderUTF16::put ( uint32  chr  )  [virtual]

Writes a character on the stream.

chr the character to write.
true success, false on stream error.

Reimplemented from Falcon::Stream.

Member Data Documentation

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

Generated on Mon Oct 19 10:11:48 2009 for Falcon_Core by  doxygen 1.5.8