Specialization of the Utf template for UTF-16. More...
#include <Utf.hpp>
Static Public Member Functions | |
template<typename In > | |
static In | Decode (In begin, In end, Uint32 &output, Uint32 replacement=0) |
Decode a single UTF-16 character. | |
template<typename Out > | |
static Out | Encode (Uint32 input, Out output, Uint16 replacement=0) |
Encode a single UTF-16 character. | |
template<typename In > | |
static In | Next (In begin, In end) |
Advance to the next UTF-16 character. | |
template<typename In > | |
static std::size_t | Count (In begin, In end) |
Count the number of characters of a UTF-16 sequence. | |
template<typename In , typename Out > | |
static Out | FromAnsi (In begin, In end, Out output, const std::locale &locale=GetDefaultLocale()) |
Convert an ANSI characters range to UTF-16. | |
template<typename In , typename Out > | |
static Out | FromWide (In begin, In end, Out output) |
Convert a wide characters range to UTF-16. | |
template<typename In , typename Out > | |
static Out | ToAnsi (In begin, In end, Out output, char replacement=0, const std::locale &locale=GetDefaultLocale()) |
Convert an UTF-16 characters range to ANSI characters. | |
template<typename In , typename Out > | |
static Out | ToWide (In begin, In end, Out output, wchar_t replacement=0) |
Convert an UTF-16 characters range to wide characters. | |
template<typename In , typename Out > | |
static Out | ToUtf8 (In begin, In end, Out output) |
Convert a UTF-16 characters range to UTF-8. | |
template<typename In , typename Out > | |
static Out | ToUtf16 (In begin, In end, Out output) |
Convert a UTF-16 characters range to UTF-16. | |
template<typename In , typename Out > | |
static Out | ToUtf32 (In begin, In end, Out output) |
Convert a UTF-16 characters range to UTF-32. |
Specialization of the Utf template for UTF-16.
Definition at line 236 of file Utf.hpp.
static std::size_t sf::Utf< 16 >::Count | ( | In | begin, | |
In | end | |||
) | [inline, static] |
Count the number of characters of a UTF-16 sequence.
This function is necessary for multi-elements encodings, as a single character may use more than 1 storage element, thus the total size can be different from (begin - end).
begin | Iterator pointing to the beginning of the input sequence | |
end | Iterator pointing to the end of the input sequence |
static In sf::Utf< 16 >::Decode | ( | In | begin, | |
In | end, | |||
Uint32 & | output, | |||
Uint32 | replacement = 0 | |||
) | [inline, static] |
Decode a single UTF-16 character.
Decoding a character means finding its unique 32-bits code (called the codepoint) in the Unicode standard.
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-16 character | |
replacement | Replacement character to use in case the UTF-8 sequence is invalid |
static Out sf::Utf< 16 >::Encode | ( | Uint32 | input, | |
Out | output, | |||
Uint16 | replacement = 0 | |||
) | [inline, static] |
Encode a single UTF-16 character.
Encoding a character means converting a unique 32-bits code (called the codepoint) in the target encoding, UTF-16.
input | Codepoint to encode as UTF-16 | |
output | Iterator pointing to the beginning of the output sequence | |
replacement | Replacement for characters not convertible to UTF-16 (use 0 to skip them) |
static Out sf::Utf< 16 >::FromAnsi | ( | In | begin, | |
In | end, | |||
Out | output, | |||
const std::locale & | locale = GetDefaultLocale() | |||
) | [inline, static] |
Convert an ANSI characters range to UTF-16.
The current global locale will be used by default, unless you pass a custom one in the locale parameter.
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 |
static Out sf::Utf< 16 >::FromWide | ( | In | begin, | |
In | end, | |||
Out | output | |||
) | [inline, static] |
Convert a wide characters range to UTF-16.
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 |
static In sf::Utf< 16 >::Next | ( | In | begin, | |
In | end | |||
) | [inline, static] |
Advance to the next UTF-16 character.
This function is necessary for multi-elements encodings, as a single character may use more than 1 storage element.
begin | Iterator pointing to the beginning of the input sequence | |
end | Iterator pointing to the end of the input sequence |
static Out sf::Utf< 16 >::ToAnsi | ( | In | begin, | |
In | end, | |||
Out | output, | |||
char | replacement = 0 , |
|||
const std::locale & | locale = GetDefaultLocale() | |||
) | [inline, static] |
Convert an UTF-16 characters range to ANSI characters.
The current global locale will be used by default, unless you pass a custom one in the locale parameter.
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 |
static Out sf::Utf< 16 >::ToUtf16 | ( | In | begin, | |
In | end, | |||
Out | output | |||
) | [inline, static] |
Convert a UTF-16 characters range to UTF-16.
This functions does nothing more than a direct copy; it is defined only to provide the same interface as other specializations of the sf::Utf<> template, and allow generic code to be written on top of it.
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 |
static Out sf::Utf< 16 >::ToUtf32 | ( | In | begin, | |
In | end, | |||
Out | output | |||
) | [inline, static] |
Convert a UTF-16 characters range to UTF-32.
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 |
static Out sf::Utf< 16 >::ToUtf8 | ( | In | begin, | |
In | end, | |||
Out | output | |||
) | [inline, static] |
Convert a UTF-16 characters range to UTF-8.
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 |
static Out sf::Utf< 16 >::ToWide | ( | In | begin, | |
In | end, | |||
Out | output, | |||
wchar_t | replacement = 0 | |||
) | [inline, static] |
Convert an UTF-16 characters range to wide characters.
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) |