The Battle for Wesnoth  1.19.7+dev
Static Public Member Functions | List of all members
ucs4_convert_impl::utf8_impl Struct Reference

#include <ucs4_convert_impl.hpp>

Static Public Member Functions

static const char * get_name ()
 
static std::size_t byte_size_from_ucs4_codepoint (char32_t ch)
 
static int byte_size_from_utf8_first (char ch)
 
template<typename writer >
static void write (writer out, char32_t ch)
 Writes a UCS-4 character to a UTF-8 stream. More...
 
template<typename iitor_t >
static char32_t read (iitor_t &input, const iitor_t &end)
 Reads a UCS-4 character from a UTF-8 stream. More...
 

Detailed Description

Definition at line 24 of file ucs4_convert_impl.hpp.

Member Function Documentation

◆ byte_size_from_ucs4_codepoint()

static std::size_t ucs4_convert_impl::utf8_impl::byte_size_from_ucs4_codepoint ( char32_t  ch)
inlinestatic

Definition at line 27 of file ucs4_convert_impl.hpp.

Referenced by read(), and write().

◆ byte_size_from_utf8_first()

static int ucs4_convert_impl::utf8_impl::byte_size_from_utf8_first ( char  ch)
inlinestatic

Definition at line 45 of file ucs4_convert_impl.hpp.

References count_leading_ones().

Referenced by read().

◆ get_name()

static const char* ucs4_convert_impl::utf8_impl::get_name ( )
inlinestatic

Definition at line 26 of file ucs4_convert_impl.hpp.

◆ read()

template<typename iitor_t >
static char32_t ucs4_convert_impl::utf8_impl::read ( iitor_t &  input,
const iitor_t &  end 
)
inlinestatic

Reads a UCS-4 character from a UTF-8 stream.

Parameters
inputAn iterator pointing to the first character of a UTF-8 sequence to read.
endAn iterator pointing to the end of the UTF-8 sequence to read.

Definition at line 96 of file ucs4_convert_impl.hpp.

References byte_size_from_ucs4_codepoint(), byte_size_from_utf8_first(), i, and utf8::size().

◆ write()

template<typename writer >
static void ucs4_convert_impl::utf8_impl::write ( writer  out,
char32_t  ch 
)
inlinestatic

Writes a UCS-4 character to a UTF-8 stream.

Parameters
outAn object to write char. Required operations: 1) push(char) to write a single character 2) can_push(std::size_t n) to check whether there is still enough space for n characters.
chThe UCS-4 character to write to the stream.

Definition at line 70 of file ucs4_convert_impl.hpp.

References byte_size_from_ucs4_codepoint(), and c.


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