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

Dynamically select encoding according to stream's runtime-specified UTF encoding type. More...

#include <encodings.h>

Public Types

enum  { supportUnicode = 1 }
 
typedef CharType Ch
 

Static Public Member Functions

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

Detailed Description

template<typename CharType>
struct AutoUTF< CharType >

Dynamically select encoding according to stream's runtime-specified UTF encoding type.

Note
This class can be used with AutoUTFInputtStream and AutoUTFOutputStream, which provides GetType().

Member Typedef Documentation

template<typename CharType >
typedef CharType AutoUTF< CharType >::Ch

Member Enumeration Documentation

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

Member Function Documentation

template<typename CharType >
template<typename InputStream >
static RAPIDJSON_FORCEINLINE bool AutoUTF< CharType >::Decode ( InputStream &  is,
unsigned *  codepoint 
)
inlinestatic
565  {
566  typedef bool (*DecodeFunc)(InputStream&, unsigned*);
567  static const DecodeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Decode) };
568  return (*f[is.GetType()])(is, codepoint);
569  }
#define RAPIDJSON_ENCODINGS_FUNC(x)
Definition: encodings.h:555
#define bool
Definition: CascPort.h:16
static RAPIDJSON_FORCEINLINE bool Decode(InputStream &is, unsigned *codepoint)
Definition: encodings.h:565
template<typename CharType >
template<typename OutputStream >
static RAPIDJSON_FORCEINLINE void AutoUTF< CharType >::Encode ( OutputStream &  os,
unsigned  codepoint 
)
inlinestatic
558  {
559  typedef void (*EncodeFunc)(OutputStream&, unsigned);
560  static const EncodeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Encode) };
561  (*f[os.GetType()])(os, codepoint);
562  }
#define RAPIDJSON_ENCODINGS_FUNC(x)
Definition: encodings.h:555
static RAPIDJSON_FORCEINLINE void Encode(OutputStream &os, unsigned codepoint)
Definition: encodings.h:558
template<typename CharType >
template<typename InputStream , typename OutputStream >
static RAPIDJSON_FORCEINLINE bool AutoUTF< CharType >::Validate ( InputStream &  is,
OutputStream &  os 
)
inlinestatic
572  {
573  typedef bool (*ValidateFunc)(InputStream&, OutputStream&);
574  static const ValidateFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Validate) };
575  return (*f[is.GetType()])(is, os);
576  }
#define RAPIDJSON_ENCODINGS_FUNC(x)
Definition: encodings.h:555
#define bool
Definition: CascPort.h:16
static RAPIDJSON_FORCEINLINE bool Validate(InputStream &is, OutputStream &os)
Definition: encodings.h:572

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