#include <transcoding.h>
Public Types | |
Public Member Functions | |
virtual FalconData * | clone () 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 |
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 | ) |
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.
Implements Falcon::Stream.
virtual bool Falcon::TranscoderUTF16::put | ( | uint32 | chr | ) | [virtual] |
Writes a character on the stream.
chr | the character to write. |
Reimplemented from Falcon::Stream.
bool Falcon::TranscoderUTF16::m_bom [protected] |