Public Types | Static Public Member Functions
utf8_writer Struct Reference

List of all members.

Public Types

typedef uint8_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 783 of file pugixml.cpp.


Member Typedef Documentation

typedef uint8_t* utf8_writer::value_type

Definition at line 785 of file pugixml.cpp.


Member Function Documentation

static value_type utf8_writer::any ( value_type  result,
uint32_t  ch 
) [inline, static]

Definition at line 822 of file pugixml.cpp.

References high(), and low().

Referenced by strconv_escape().

                {
                        return (ch < 0x10000) ? low(result, ch) : high(result, ch);
                }
static value_type utf8_writer::high ( value_type  result,
uint32_t  ch 
) [inline, static]

Definition at line 812 of file pugixml.cpp.

Referenced by any().

                {
                        // U+10000..U+10FFFF
                        result[0] = static_cast<uint8_t>(0xF0 | (ch >> 18));
                        result[1] = static_cast<uint8_t>(0x80 | ((ch >> 12) & 0x3F));
                        result[2] = static_cast<uint8_t>(0x80 | ((ch >> 6) & 0x3F));
                        result[3] = static_cast<uint8_t>(0x80 | (ch & 0x3F));
                        return result + 4;
                }
static value_type utf8_writer::low ( value_type  result,
uint32_t  ch 
) [inline, static]

Definition at line 787 of file pugixml.cpp.

Referenced by any().

                {
                        // U+0000..U+007F
                        if (ch < 0x80)
                        {
                                *result = static_cast<uint8_t>(ch);
                                return result + 1;
                        }
                        // U+0080..U+07FF
                        else if (ch < 0x800)
                        {
                                result[0] = static_cast<uint8_t>(0xC0 | (ch >> 6));
                                result[1] = static_cast<uint8_t>(0x80 | (ch & 0x3F));
                                return result + 2;
                        }
                        // U+0800..U+FFFF
                        else
                        {
                                result[0] = static_cast<uint8_t>(0xE0 | (ch >> 12));
                                result[1] = static_cast<uint8_t>(0x80 | ((ch >> 6) & 0x3F));
                                result[2] = static_cast<uint8_t>(0x80 | (ch & 0x3F));
                                return result + 3;
                        }
                }

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

Generated on Mon Sep 15 2014 01:23:55 for QuickFIX by doxygen 1.7.6.1 written by Dimitri van Heesch, © 1997-2001