TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Transcoder< SourceEncoding, TargetEncoding > Struct Template Reference

Encoding conversion. More...

#include <encodings.h>

Static Public Member Functions

template<typename InputStream , typename OutputStream >
static RAPIDJSON_FORCEINLINE bool Transcode (InputStream &is, OutputStream &os)
 Take one Unicode codepoint from source encoding, convert it to target encoding and put it to the output stream. More...
 
template<typename InputStream , typename OutputStream >
static RAPIDJSON_FORCEINLINE bool Validate (InputStream &is, OutputStream &os)
 Validate one Unicode codepoint from an encoded stream. More...
 

Detailed Description

template<typename SourceEncoding, typename TargetEncoding>
struct Transcoder< SourceEncoding, TargetEncoding >

Encoding conversion.

Member Function Documentation

template<typename SourceEncoding , typename TargetEncoding >
template<typename InputStream , typename OutputStream >
static RAPIDJSON_FORCEINLINE bool Transcoder< SourceEncoding, TargetEncoding >::Transcode ( InputStream &  is,
OutputStream &  os 
)
inlinestatic

Take one Unicode codepoint from source encoding, convert it to target encoding and put it to the output stream.

589  {
590  unsigned codepoint;
591  if (!SourceEncoding::Decode(is, &codepoint))
592  return false;
593  TargetEncoding::Encode(os, codepoint);
594  return true;
595  }

+ Here is the caller graph for this function:

template<typename SourceEncoding , typename TargetEncoding >
template<typename InputStream , typename OutputStream >
static RAPIDJSON_FORCEINLINE bool Transcoder< SourceEncoding, TargetEncoding >::Validate ( InputStream &  is,
OutputStream &  os 
)
inlinestatic

Validate one Unicode codepoint from an encoded stream.

599  {
600  return Transcode(is, os); // Since source/target encoding is different, must transcode.
601  }
static RAPIDJSON_FORCEINLINE bool Transcode(InputStream &is, OutputStream &os)
Take one Unicode codepoint from source encoding, convert it to target encoding and put it to the outp...
Definition: encodings.h:589

+ Here is the call graph for this function:


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