Public Types | Static Public Member Functions | List of all members
utf16_writer Struct Reference

Public Types

typedef uint16_t * value_type
 

Static Public Member Functions

static value_type low (value_type result, uint32_t ch)
 
static value_type high (value_type result, uint32_t ch)
 
static value_type any (value_type result, uint32_t ch)
 

Detailed Description

Definition at line 843 of file pugixml.cpp.

Member Typedef Documentation

◆ value_type

typedef uint16_t* utf16_writer::value_type

Definition at line 845 of file pugixml.cpp.

Member Function Documentation

◆ any()

static value_type utf16_writer::any ( value_type  result,
uint32_t  ch 
)
inlinestatic

Definition at line 865 of file pugixml.cpp.

866  {
867  return (ch < 0x10000) ? low(result, ch) : high(result, ch);
868  }
static value_type low(value_type result, uint32_t ch)
Definition: pugixml.cpp:847
static value_type high(value_type result, uint32_t ch)
Definition: pugixml.cpp:854

◆ high()

static value_type utf16_writer::high ( value_type  result,
uint32_t  ch 
)
inlinestatic

Definition at line 854 of file pugixml.cpp.

855  {
856  uint32_t msh = static_cast<uint32_t>(ch - 0x10000) >> 10;
857  uint32_t lsh = static_cast<uint32_t>(ch - 0x10000) & 0x3ff;
858 
859  result[0] = static_cast<uint16_t>(0xD800 + msh);
860  result[1] = static_cast<uint16_t>(0xDC00 + lsh);
861 
862  return result + 2;
863  }

◆ low()

static value_type utf16_writer::low ( value_type  result,
uint32_t  ch 
)
inlinestatic

Definition at line 847 of file pugixml.cpp.

848  {
849  *result = static_cast<uint16_t>(ch);
850 
851  return result + 1;
852  }

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

Generated on Thu Sep 5 2019 11:07:58 for QuickFIX by doxygen 1.8.13 written by Dimitri van Heesch, © 1997-2001