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

UTF-16 little endian encoding. More...

#include <encodings.h>

Static Public Member Functions

template<typename InputByteStream >
static CharType TakeBOM (InputByteStream &is)
 
template<typename InputByteStream >
static CharType Take (InputByteStream &is)
 
template<typename OutputByteStream >
static void PutBOM (OutputByteStream &os)
 
template<typename OutputByteStream >
static void Put (OutputByteStream &os, CharType c)
 
- Static Public Member Functions inherited from UTF16< CharType >
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)
 

Additional Inherited Members

- Public Types inherited from UTF16< CharType >
enum  { supportUnicode = 1 }
 
typedef CharType Ch
 
- Public Member Functions inherited from UTF16< CharType >
 RAPIDJSON_STATIC_ASSERT (sizeof(Ch) >=2)
 

Detailed Description

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

UTF-16 little endian encoding.

Member Function Documentation

template<typename CharType = wchar_t>
template<typename OutputByteStream >
static void UTF16LE< CharType >::Put ( OutputByteStream &  os,
CharType  c 
)
inlinestatic
321  {
322  RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
323  os.Put(c & 0xFFu);
324  os.Put((c >> 8) & 0xFFu);
325  }
RAPIDJSON_STATIC_ASSERT(sizeof(Ch) >=2)

+ Here is the call graph for this function:

template<typename CharType = wchar_t>
template<typename OutputByteStream >
static void UTF16LE< CharType >::PutBOM ( OutputByteStream &  os)
inlinestatic
315  {
316  RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
317  os.Put(0xFFu); os.Put(0xFEu);
318  }
RAPIDJSON_STATIC_ASSERT(sizeof(Ch) >=2)

+ Here is the call graph for this function:

template<typename CharType = wchar_t>
template<typename InputByteStream >
static CharType UTF16LE< CharType >::Take ( InputByteStream &  is)
inlinestatic
307  {
308  RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
309  CharType c = (unsigned char)is.Take();
310  c |= (unsigned char)is.Take() << 8;
311  return c;
312  }
RAPIDJSON_STATIC_ASSERT(sizeof(Ch) >=2)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename CharType = wchar_t>
template<typename InputByteStream >
static CharType UTF16LE< CharType >::TakeBOM ( InputByteStream &  is)
inlinestatic
300  {
301  RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
302  CharType c = Take(is);
303  return (unsigned short)c == 0xFEFFu ? Take(is) : c;
304  }
RAPIDJSON_STATIC_ASSERT(sizeof(Ch) >=2)
static CharType Take(InputByteStream &is)
Definition: encodings.h:307

+ Here is the call graph for this function:


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