textwolf  0.2
Public Types | Public Member Functions | Static Public Member Functions | List of all members
textwolf::charset::UTF16< encoding > Class Template Reference

Character set UTF16 (little/big endian) More...

#include <charset_utf16.hpp>

Public Types

enum  { MaxChar =0x10FFFFU }
 

Public Member Functions

template<class Iterator >
UChar value (char *buf, unsigned int &bufpos, Iterator &itr) const
 
template<class Buffer_ >
void print (UChar ch, Buffer_ &buf) const
 See template<class Buffer>Interface::print(UChar,Buffer&) More...
 

Static Public Member Functions

template<class Iterator >
static void fetchbytes (char *buf, unsigned int &bufpos, Iterator &itr)
 See template<class Iterator>Interface::fetchbytes(char*,unsigned int&,Iterator&) More...
 
template<class Iterator >
static unsigned int size (char *buf, unsigned int &bufpos, Iterator &itr)
 Get the size of the current character in bytes (variable length encoding) More...
 
template<class Iterator >
static void skip (char *buf, unsigned int &bufpos, Iterator &itr)
 See template<class Iterator>Interface::skip(char*,unsigned int&,Iterator&) More...
 
template<class Iterator >
static signed char asciichar (char *buf, unsigned int &bufpos, Iterator &itr)
 See template<class Iterator>Interface::asciichar(char*,unsigned int&,Iterator&) More...
 
template<class Iterator >
static UChar value_impl (char *buf, unsigned int &bufpos, Iterator &itr)
 See template<class Iterator>Interface::value(char*,unsigned int&,Iterator&) More...
 
static bool is_equal (const UTF16 &, const UTF16 &)
 See template<class Buffer>Interface::is_equal( const Interface&, const Interface&) More...
 

Detailed Description

template<int encoding = ByteOrder::BE>
class textwolf::charset::UTF16< encoding >

Character set UTF16 (little/big endian)

Template Parameters
encodingByteOrder::LE or ByteOrder::BE
Remarks
BOM character sequences are not interpreted as such and byte swapping is not done implicitely It is left to the caller to detect BOM or its inverse and to switch the iterator.
See http://en.wikipedia.org/wiki/UTF-16/UCS-2: ... If the endian architecture of the decoder matches that of the encoder, the decoder detects the 0xFEFF value, but an opposite-endian decoder interprets the BOM as the non-character value U+FFFE reserved for this purpose. This incorrect result provides a hint to perform byte-swapping for the remaining values. If the BOM is missing, the standard says that big-endian encoding should be assumed....

Member Enumeration Documentation

template<int encoding = ByteOrder::BE>
anonymous enum
Enumerator
MaxChar 

Member Function Documentation

template<int encoding = ByteOrder::BE>
template<class Iterator >
static signed char textwolf::charset::UTF16< encoding >::asciichar ( char *  buf,
unsigned int &  bufpos,
Iterator &  itr 
)
inlinestatic
template<int encoding = ByteOrder::BE>
template<class Iterator >
static void textwolf::charset::UTF16< encoding >::fetchbytes ( char *  buf,
unsigned int &  bufpos,
Iterator &  itr 
)
inlinestatic
template<int encoding = ByteOrder::BE>
static bool textwolf::charset::UTF16< encoding >::is_equal ( const UTF16< encoding > &  ,
const UTF16< encoding > &   
)
inlinestatic
template<int encoding = ByteOrder::BE>
template<class Buffer_ >
void textwolf::charset::UTF16< encoding >::print ( UChar  ch,
Buffer_ &  buf 
) const
inline

See template<class Buffer>Interface::print(UChar,Buffer&)

template<int encoding = ByteOrder::BE>
template<class Iterator >
static unsigned int textwolf::charset::UTF16< encoding >::size ( char *  buf,
unsigned int &  bufpos,
Iterator &  itr 
)
inlinestatic

Get the size of the current character in bytes (variable length encoding)

Parameters
[in]bufbuffer for the character data
[in,out]bufposposition in 'buf'
[in,out]itriterator
template<int encoding = ByteOrder::BE>
template<class Iterator >
static void textwolf::charset::UTF16< encoding >::skip ( char *  buf,
unsigned int &  bufpos,
Iterator &  itr 
)
inlinestatic
template<int encoding = ByteOrder::BE>
template<class Iterator >
UChar textwolf::charset::UTF16< encoding >::value ( char *  buf,
unsigned int &  bufpos,
Iterator &  itr 
) const
inline
template<int encoding = ByteOrder::BE>
template<class Iterator >
static UChar textwolf::charset::UTF16< encoding >::value_impl ( char *  buf,
unsigned int &  bufpos,
Iterator &  itr 
)
inlinestatic

See template<class Iterator>Interface::value(char*,unsigned int&,Iterator&)


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