TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
UTF32< CharType > Struct Template Reference

UTF-32 encoding. More...

#include <encodings.h>

Public Types

enum  { supportUnicode = 1 }
 
typedef CharType Ch
 

Public Member Functions

 RAPIDJSON_STATIC_ASSERT (sizeof(Ch) >=4)
 

Static Public Member Functions

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

Detailed Description

template<typename CharType = unsigned>
struct UTF32< CharType >

UTF-32 encoding.

http://en.wikipedia.org/wiki/UTF-32

Template Parameters
CharTypeType for storing 32-bit UTF-32 data. Default is unsigned. C++11 may use char32_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 UTF32LE and UTF32BE, which handle endianness.

Member Typedef Documentation

template<typename CharType = unsigned>
typedef CharType UTF32< CharType >::Ch

Member Enumeration Documentation

template<typename CharType = unsigned>
anonymous enum
Enumerator
supportUnicode 
376 { supportUnicode = 1 };
Definition: encodings.h:376

Member Function Documentation

template<typename CharType = unsigned>
template<typename InputStream >
static bool UTF32< CharType >::Decode ( InputStream &  is,
unsigned *  codepoint 
)
inlinestatic
386  {
387  RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 4);
388  Ch c = is.Take();
389  *codepoint = c;
390  return c <= 0x10FFFF;
391  }
CharType Ch
Definition: encodings.h:373
RAPIDJSON_STATIC_ASSERT(sizeof(Ch) >=4)

+ Here is the call graph for this function:

template<typename CharType = unsigned>
template<typename OutputStream >
static void UTF32< CharType >::Encode ( OutputStream &  os,
unsigned  codepoint 
)
inlinestatic
379  {
380  RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 4);
381  RAPIDJSON_ASSERT(codepoint <= 0x10FFFF);
382  os.Put(codepoint);
383  }
#define RAPIDJSON_ASSERT(x)
Assertion.
Definition: rapidjson.h:344
RAPIDJSON_STATIC_ASSERT(sizeof(Ch) >=4)

+ Here is the call graph for this function:

template<typename CharType = unsigned>
UTF32< CharType >::RAPIDJSON_STATIC_ASSERT ( sizeof(Ch) >=  4)

+ Here is the caller graph for this function:

template<typename CharType = unsigned>
template<typename InputStream , typename OutputStream >
static bool UTF32< CharType >::Validate ( InputStream &  is,
OutputStream &  os 
)
inlinestatic
394  {
395  RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 4);
396  Ch c;
397  os.Put(c = is.Take());
398  return c <= 0x10FFFF;
399  }
CharType Ch
Definition: encodings.h:373
RAPIDJSON_STATIC_ASSERT(sizeof(Ch) >=4)

+ Here is the call graph for this function:


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