Public Types | Public Member Functions | Static Public Member Functions | List of all members
UTF16< CharType > Struct Template Reference

UTF-16 encoding. More...

#include <encodings.h>

Inheritance diagram for UTF16< CharType >:
Inheritance graph
[legend]

Public Types

enum  { supportUnicode = 1 }
 
typedef CharType Ch
 

Public Member Functions

 RAPIDJSON_STATIC_ASSERT (sizeof(Ch) >=2)
 

Static Public Member Functions

template<typename InputStream >
static bool Decode (InputStream &is, unsigned *codepoint)
 
template<typename OutputStream >
static void Encode (OutputStream &os, unsigned codepoint)
 
template<typename OutputStream >
static void EncodeUnsafe (OutputStream &os, unsigned codepoint)
 
template<typename InputStream , typename OutputStream >
static bool Validate (InputStream &is, OutputStream &os)
 

Detailed Description

template<typename CharType = wchar_t>
struct UTF16< CharType >

UTF-16 encoding.

http://en.wikipedia.org/wiki/UTF-16 http://tools.ietf.org/html/rfc2781

Template Parameters
CharTypeType for storing 16-bit UTF-16 data. Default is wchar_t. C++11 may use char16_t instead.
Note
implements Encoding concept
For in-memory access, no need to concern endianness. The code units and code points are represented by CPU's endianness. For streaming, use UTF16LE and UTF16BE, which handle endianness.

Definition at line 364 of file encodings.h.

Member Typedef Documentation

template<typename CharType = wchar_t>
typedef CharType UTF16< CharType >::Ch

Definition at line 366 of file encodings.h.

Member Enumeration Documentation

template<typename CharType = wchar_t>
anonymous enum
Enumerator
supportUnicode 

Definition at line 369 of file encodings.h.

Member Function Documentation

template<typename CharType = wchar_t>
template<typename InputStream >
static bool UTF16< CharType >::Decode ( InputStream &  is,
unsigned *  codepoint 
)
inlinestatic

Definition at line 411 of file encodings.h.

template<typename CharType = wchar_t>
template<typename OutputStream >
static void UTF16< CharType >::Encode ( OutputStream &  os,
unsigned  codepoint 
)
inlinestatic

Definition at line 375 of file encodings.h.

template<typename CharType = wchar_t>
template<typename OutputStream >
static void UTF16< CharType >::EncodeUnsafe ( OutputStream &  os,
unsigned  codepoint 
)
inlinestatic

Definition at line 393 of file encodings.h.

template<typename CharType = wchar_t>
UTF16< CharType >::RAPIDJSON_STATIC_ASSERT ( sizeof(Ch) >=  2)
template<typename CharType = wchar_t>
template<typename InputStream , typename OutputStream >
static bool UTF16< CharType >::Validate ( InputStream &  is,
OutputStream &  os 
)
inlinestatic

Definition at line 432 of file encodings.h.


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


xbot_talker
Author(s): wangxiaoyun
autogenerated on Sat Oct 10 2020 03:27:54