.. index:: pair: class; EE::Utf<32> .. _doxid-class_e_e_1_1_utf_3_0132_01_4: template class EE::Utf<32> ========================== .. toctree:: :hidden: Overview ~~~~~~~~ Specialization of the :ref:`Utf ` template for UTF-32. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include template <> class Utf<32> { public: // methods template static In :ref:`decode`(In begin, In end, :ref:`Uint32`& output, :ref:`Uint32` replacement = 0); template static Out :ref:`encode`(:ref:`Uint32` input, Out output, :ref:`Uint32` replacement = 0); template static In :ref:`next`(In begin, In end); template static std::size_t :ref:`count`(In begin, In end); template static Out :ref:`fromAnsi`(In begin, In end, Out output, const std::locale& locale = std::locale()); template static Out :ref:`fromWide`(In begin, In end, Out output); template static Out :ref:`fromLatin1`(In begin, In end, Out output); template static Out :ref:`toAnsi`(In begin, In end, Out output, char replacement = 0, const std::locale& locale = std::locale()); template static Out :ref:`toWide`(In begin, In end, Out output, wchar_t replacement = 0); template static Out :ref:`toLatin1`(In begin, In end, Out output, char replacement = 0); template static Out :ref:`toUtf8`(In begin, In end, Out output); template static Out :ref:`toUtf16`(In begin, In end, Out output); template static Out :ref:`toUtf32`(In begin, In end, Out output); template static :ref:`Uint32` :ref:`decodeAnsi`(In input, const std::locale& locale = std::locale()); template static :ref:`Uint32` :ref:`decodeWide`(In input); template static Out :ref:`encodeAnsi`(:ref:`Uint32` codepoint, Out output, char replacement = 0, const std::locale& locale = std::locale()); template static Out :ref:`encodeWide`(:ref:`Uint32` codepoint, Out output, wchar_t replacement = 0); }; .. _details-class_e_e_1_1_utf_3_0132_01_4: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Specialization of the :ref:`Utf ` template for UTF-32. Methods ------- .. index:: pair: function; decode .. _doxid-class_e_e_1_1_utf_3_0132_01_4_1acc6519506dc46c4881e8e1bca52a0467: .. ref-code-block:: cpp :class: doxyrest-title-code-block template static In decode(In begin, In end, :ref:`Uint32`& output, :ref:`Uint32` replacement = 0) Decode a single UTF-32 character. Decoding a character means finding its unique 32-bits code (called the codepoint) in the Unicode standard. For UTF-32, the character value is the same as the codepoint. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - begin - Iterator pointing to the beginning of the input sequence * - end - Iterator pointing to the end of the input sequence * - output - Codepoint of the decoded UTF-32 character * - replacement - Replacement character to use in case the UTF-8 sequence is invalid .. rubric:: Returns: Iterator pointing to one past the last read element of the input sequence .. index:: pair: function; encode .. _doxid-class_e_e_1_1_utf_3_0132_01_4_1a393fa291da4e30f4d9d6503c6a344290: .. ref-code-block:: cpp :class: doxyrest-title-code-block template static Out encode(:ref:`Uint32` input, Out output, :ref:`Uint32` replacement = 0) Encode a single UTF-32 character. Encoding a character means converting a unique 32-bits code (called the codepoint) in the target encoding, UTF-32. For UTF-32, the codepoint is the same as the character value. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - input - Codepoint to encode as UTF-32 * - output - Iterator pointing to the beginning of the output sequence * - replacement - Replacement for characters not convertible to UTF-32 (use 0 to skip them) .. rubric:: Returns: Iterator to the end of the output sequence which has been written .. index:: pair: function; next .. _doxid-class_e_e_1_1_utf_3_0132_01_4_1ad3fe757aa64773ecdf3bbac26e49972d: .. ref-code-block:: cpp :class: doxyrest-title-code-block template static In next(In begin, In end) Advance to the next UTF-32 character. This function is trivial for UTF-32, which can store every character in a single storage element. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - begin - Iterator pointing to the beginning of the input sequence * - end - Iterator pointing to the end of the input sequence .. rubric:: Returns: Iterator pointing to one past the last read element of the input sequence .. index:: pair: function; count .. _doxid-class_e_e_1_1_utf_3_0132_01_4_1a1eb20fa6c0d148ca06ae7e8414489d9b: .. ref-code-block:: cpp :class: doxyrest-title-code-block template static std::size_t count(In begin, In end) Count the number of characters of a UTF-32 sequence. This function is trivial for UTF-32, which can store every character in a single storage element. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - begin - Iterator pointing to the beginning of the input sequence * - end - Iterator pointing to the end of the input sequence .. rubric:: Returns: Iterator pointing to one past the last read element of the input sequence .. index:: pair: function; fromAnsi .. _doxid-class_e_e_1_1_utf_3_0132_01_4_1a9050dd138e500f88df5cbdb26767f234: .. ref-code-block:: cpp :class: doxyrest-title-code-block template static Out fromAnsi(In begin, In end, Out output, const std::locale& locale = std::locale()) Convert an ANSI characters range to UTF-32. The current global locale will be used by default, unless you pass a custom one in the *locale* parameter. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - begin - Iterator pointing to the beginning of the input sequence * - end - Iterator pointing to the end of the input sequence * - output - Iterator pointing to the beginning of the output sequence * - locale - Locale to use for conversion .. rubric:: Returns: Iterator to the end of the output sequence which has been written .. index:: pair: function; fromWide .. _doxid-class_e_e_1_1_utf_3_0132_01_4_1a0170a1edc03b12183f81b2cb6872cd3c: .. ref-code-block:: cpp :class: doxyrest-title-code-block template static Out fromWide(In begin, In end, Out output) Convert a wide characters range to UTF-32. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - begin - Iterator pointing to the beginning of the input sequence * - end - Iterator pointing to the end of the input sequence * - output - Iterator pointing to the beginning of the output sequence .. rubric:: Returns: Iterator to the end of the output sequence which has been written .. index:: pair: function; fromLatin1 .. _doxid-class_e_e_1_1_utf_3_0132_01_4_1a7c55f1baeea9bbbf95d776c3d18b20f3: .. ref-code-block:: cpp :class: doxyrest-title-code-block template static Out fromLatin1(In begin, In end, Out output) Convert a latin-1 (ISO-8859-1) characters range to UTF-32. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - begin - Iterator pointing to the beginning of the input sequence * - end - Iterator pointing to the end of the input sequence * - output - Iterator pointing to the beginning of the output sequence .. rubric:: Returns: Iterator to the end of the output sequence which has been written .. index:: pair: function; toAnsi .. _doxid-class_e_e_1_1_utf_3_0132_01_4_1aee24ad29a8d55734a55d1c143ed7a126: .. ref-code-block:: cpp :class: doxyrest-title-code-block template static Out toAnsi(In begin, In end, Out output, char replacement = 0, const std::locale& locale = std::locale()) Convert an UTF-32 characters range to ANSI characters. The current global locale will be used by default, unless you pass a custom one in the *locale* parameter. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - begin - Iterator pointing to the beginning of the input sequence * - end - Iterator pointing to the end of the input sequence * - output - Iterator pointing to the beginning of the output sequence * - replacement - Replacement for characters not convertible to ANSI (use 0 to skip them) * - locale - Locale to use for conversion .. rubric:: Returns: Iterator to the end of the output sequence which has been written .. index:: pair: function; toWide .. _doxid-class_e_e_1_1_utf_3_0132_01_4_1a99594129ead233eda876f2209d74e638: .. ref-code-block:: cpp :class: doxyrest-title-code-block template static Out toWide(In begin, In end, Out output, wchar_t replacement = 0) Convert an UTF-32 characters range to wide characters. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - begin - Iterator pointing to the beginning of the input sequence * - end - Iterator pointing to the end of the input sequence * - output - Iterator pointing to the beginning of the output sequence * - replacement - Replacement for characters not convertible to wide (use 0 to skip them) .. rubric:: Returns: Iterator to the end of the output sequence which has been written .. index:: pair: function; toLatin1 .. _doxid-class_e_e_1_1_utf_3_0132_01_4_1a30c0dfc50adaed5a2fb6a122f402c053: .. ref-code-block:: cpp :class: doxyrest-title-code-block template static Out toLatin1(In begin, In end, Out output, char replacement = 0) Convert an UTF-16 characters range to latin-1 (ISO-8859-1) characters. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - begin - Iterator pointing to the beginning of the input sequence * - end - Iterator pointing to the end of the input sequence * - output - Iterator pointing to the beginning of the output sequence * - replacement - Replacement for characters not convertible to wide (use 0 to skip them) .. rubric:: Returns: Iterator to the end of the output sequence which has been written .. index:: pair: function; toUtf8 .. _doxid-class_e_e_1_1_utf_3_0132_01_4_1ab1d0808e0d3ef54cd08f604446a12694: .. ref-code-block:: cpp :class: doxyrest-title-code-block template static Out toUtf8(In begin, In end, Out output) Convert a UTF-32 characters range to UTF-8. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - begin - Iterator pointing to the beginning of the input sequence * - end - Iterator pointing to the end of the input sequence * - output - Iterator pointing to the beginning of the output sequence .. rubric:: Returns: Iterator to the end of the output sequence which has been written .. index:: pair: function; toUtf16 .. _doxid-class_e_e_1_1_utf_3_0132_01_4_1a865955ddd4f940c5b911669aa7f051ba: .. ref-code-block:: cpp :class: doxyrest-title-code-block template static Out toUtf16(In begin, In end, Out output) Convert a UTF-32 characters range to UTF-16. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - begin - Iterator pointing to the beginning of the input sequence * - end - Iterator pointing to the end of the input sequence * - output - Iterator pointing to the beginning of the output sequence .. rubric:: Returns: Iterator to the end of the output sequence which has been written .. index:: pair: function; toUtf32 .. _doxid-class_e_e_1_1_utf_3_0132_01_4_1aa6572c5110cf87f587721e32552f4232: .. ref-code-block:: cpp :class: doxyrest-title-code-block template static Out toUtf32(In begin, In end, Out output) Convert a UTF-32 characters range to UTF-32. This functions does nothing more than a direct copy; it is defined only to provide the same interface as other specializations of the EE::Utf<> template, and allow generic code to be written on top of it. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - begin - Iterator pointing to the beginning of the input sequence * - end - Iterator pointing to the end of the input sequence * - output - Iterator pointing to the beginning of the output sequence .. rubric:: Returns: Iterator to the end of the output sequence which has been written .. index:: pair: function; decodeAnsi .. _doxid-class_e_e_1_1_utf_3_0132_01_4_1a8c8f629f022c861c5e9dfd8cce2caf90: .. ref-code-block:: cpp :class: doxyrest-title-code-block template static :ref:`Uint32` decodeAnsi(In input, const std::locale& locale = std::locale()) Decode a single ANSI character to UTF-32. This function does not exist in other specializations of EE::Utf<>, it is defined for convenience (it is used by several other conversion functions). .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - input - Input ANSI character * - locale - Locale to use for conversion .. rubric:: Returns: Converted character .. index:: pair: function; decodeWide .. _doxid-class_e_e_1_1_utf_3_0132_01_4_1a8c43ee6a63684f800ad1086b3c201f1a: .. ref-code-block:: cpp :class: doxyrest-title-code-block template static :ref:`Uint32` decodeWide(In input) Decode a single wide character to UTF-32. This function does not exist in other specializations of EE::Utf<>, it is defined for convenience (it is used by several other conversion functions). .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - input - Input wide character .. rubric:: Returns: Converted character .. index:: pair: function; encodeAnsi .. _doxid-class_e_e_1_1_utf_3_0132_01_4_1ac0b60cd53ad5f7e128a1dec9057bf618: .. ref-code-block:: cpp :class: doxyrest-title-code-block template static Out encodeAnsi(:ref:`Uint32` codepoint, Out output, char replacement = 0, const std::locale& locale = std::locale()) Encode a single UTF-32 character to ANSI. This function does not exist in other specializations of EE::Utf<>, it is defined for convenience (it is used by several other conversion functions). .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - codepoint - Iterator pointing to the beginning of the input sequence * - output - Iterator pointing to the beginning of the output sequence * - replacement - Replacement if the input character is not convertible to ANSI (use 0 to skip it) * - locale - Locale to use for conversion .. rubric:: Returns: Iterator to the end of the output sequence which has been written .. index:: pair: function; encodeWide .. _doxid-class_e_e_1_1_utf_3_0132_01_4_1a38003d3137b9ac73440b3d16ed062612: .. ref-code-block:: cpp :class: doxyrest-title-code-block template static Out encodeWide(:ref:`Uint32` codepoint, Out output, wchar_t replacement = 0) Encode a single UTF-32 character to wide. This function does not exist in other specializations of EE::Utf<>, it is defined for convenience (it is used by several other conversion functions). .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - codepoint - Iterator pointing to the beginning of the input sequence * - output - Iterator pointing to the beginning of the output sequence * - replacement - Replacement if the input character is not convertible to wide (use 0 to skip it) .. rubric:: Returns: Iterator to the end of the output sequence which has been written