Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
UTF16BE< CharType > Struct Template Reference

UTF-16 big endian encoding. More...

#include <encodings.h>

Inheritance diagram for UTF16BE< CharType >:
Collaboration diagram for UTF16BE< CharType >:

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< wchar_t >
static void Encode (OutputStream &os, unsigned codepoint)
 
static void EncodeUnsafe (OutputStream &os, unsigned codepoint)
 
static bool Decode (InputStream &is, unsigned *codepoint)
 
static bool Validate (InputStream &is, OutputStream &os)
 

Additional Inherited Members

- Public Types inherited from UTF16< wchar_t >
enum  
 
typedef wchar_t Ch
 
- Public Member Functions inherited from UTF16< wchar_t >
 RAPIDJSON_STATIC_ASSERT (sizeof(Ch) >=2)
 

Detailed Description

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

Definition at line 375 of file encodings.h.

Member Function Documentation

◆ Put()

template<typename CharType = wchar_t>
template<typename OutputByteStream >
static void UTF16BE< CharType >::Put ( OutputByteStream & os,
CharType c )
inlinestatic

Definition at line 399 of file encodings.h.

399 {
400 RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
401 os.Put(static_cast<typename OutputByteStream::Ch>((static_cast<unsigned>(c) >> 8) & 0xFFu));
402 os.Put(static_cast<typename OutputByteStream::Ch>(static_cast<unsigned>(c) & 0xFFu));
403 }
os_t os
#define RAPIDJSON_STATIC_ASSERT(x)
(Internal) macro to check for conditions at compile-time
Definition rapidjson.h:445

◆ PutBOM()

template<typename CharType = wchar_t>
template<typename OutputByteStream >
static void UTF16BE< CharType >::PutBOM ( OutputByteStream & os)
inlinestatic

Definition at line 392 of file encodings.h.

392 {
393 RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
394 os.Put(static_cast<typename OutputByteStream::Ch>(0xFEu));
395 os.Put(static_cast<typename OutputByteStream::Ch>(0xFFu));
396 }

◆ Take()

template<typename CharType = wchar_t>
template<typename InputByteStream >
static CharType UTF16BE< CharType >::Take ( InputByteStream & is)
inlinestatic

Definition at line 384 of file encodings.h.

384 {
385 RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
386 unsigned c = static_cast<unsigned>(static_cast<uint8_t>(is.Take())) << 8;
387 c |= static_cast<unsigned>(static_cast<uint8_t>(is.Take()));
388 return static_cast<CharType>(c);
389 }
unsigned char uint8_t
Definition stdint.h:124
Here is the caller graph for this function:

◆ TakeBOM()

template<typename CharType = wchar_t>
template<typename InputByteStream >
static CharType UTF16BE< CharType >::TakeBOM ( InputByteStream & is)
inlinestatic

Definition at line 377 of file encodings.h.

377 {
378 RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
379 CharType c = Take(is);
380 return static_cast<uint16_t>(c) == 0xFEFFu ? Take(is) : c;
381 }
unsigned short uint16_t
Definition stdint.h:125
static CharType Take(InputByteStream &is)
Definition encodings.h:384
Here is the call graph for this function:

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