Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
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.
 
template<typename InputStream , typename OutputStream >
static RAPIDJSON_FORCEINLINE bool TranscodeUnsafe (InputStream &is, OutputStream &os)
 
template<typename InputStream , typename OutputStream >
static RAPIDJSON_FORCEINLINE bool Validate (InputStream &is, OutputStream &os)
 Validate one Unicode codepoint from an encoded stream.
 

Detailed Description

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

Definition at line 658 of file encodings.h.

Member Function Documentation

◆ Transcode()

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

Definition at line 661 of file encodings.h.

661 {
662 unsigned codepoint;
663 if (!SourceEncoding::Decode(is, &codepoint))
664 return false;
665 TargetEncoding::Encode(os, codepoint);
666 return true;
667 }
os_t os
Here is the caller graph for this function:

◆ TranscodeUnsafe()

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

Definition at line 670 of file encodings.h.

670 {
671 unsigned codepoint;
672 if (!SourceEncoding::Decode(is, &codepoint))
673 return false;
674 TargetEncoding::EncodeUnsafe(os, codepoint);
675 return true;
676 }

◆ Validate()

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

Definition at line 680 of file encodings.h.

680 {
681 return Transcode(is, os); // Since source/target encoding is different, must transcode.
682 }
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:661
Here is the call graph for this function:

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