sf::Utf< 32 > Class Template Reference

Specialization of the Utf template for UTF-16. More...

#include <Utf.hpp>

List of all members.

Static Public Member Functions

template<typename In >
static In Decode (In begin, In end, Uint32 &output, Uint32 replacement=0)
 Decode a single UTF-32 character.
template<typename Out >
static Out Encode (Uint32 input, Out output, Uint32 replacement=0)
 Encode a single UTF-32 character.
template<typename In >
static In Next (In begin, In end)
 Advance to the next UTF-32 character.
template<typename In >
static std::size_t Count (In begin, In end)
 Count the number of characters of a UTF-32 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-32.
template<typename In , typename Out >
static Out FromWide (In begin, In end, Out output)
 Convert a wide characters range to UTF-32.
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-32 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-32 characters range to wide characters.
template<typename In , typename Out >
static Out ToUtf8 (In begin, In end, Out output)
 Convert a UTF-32 characters range to UTF-8.
template<typename In , typename Out >
static Out ToUtf16 (In begin, In end, Out output)
 Convert a UTF-32 characters range to UTF-16.
template<typename In , typename Out >
static Out ToUtf32 (In begin, In end, Out output)
 Convert a UTF-32 characters range to UTF-32.
template<typename In >
static Uint32 DecodeAnsi (In input, const std::locale &locale=GetDefaultLocale())
 Decode a single ANSI character to UTF-32.
template<typename In >
static Uint32 DecodeWide (In input)
 Decode a single wide character to UTF-32.
template<typename Out >
static Out EncodeAnsi (Uint32 codepoint, Out output, char replacement=0, const std::locale &locale=GetDefaultLocale())
 Encode a single UTF-32 character to ANSI.
template<typename Out >
static Out EncodeWide (Uint32 codepoint, Out output, wchar_t replacement=0)
 Encode a single UTF-32 character to wide.

Detailed Description

template<>
class sf::Utf< 32 >

Specialization of the Utf template for UTF-16.

Definition at line 416 of file Utf.hpp.


Member Function Documentation

template<typename In >
static std::size_t sf::Utf< 32 >::Count ( In  begin,
In  end 
) [inline, static]

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.

Parameters:
begin Iterator pointing to the beginning of the input sequence
end Iterator pointing to the end of the input sequence
Returns:
Iterator pointing to one past the last read element of the input sequence
template<typename In >
static In sf::Utf< 32 >::Decode ( In  begin,
In  end,
Uint32 &  output,
Uint32  replacement = 0 
) [inline, static]

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.

Parameters:
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
Returns:
Iterator pointing to one past the last read element of the input sequence
template<typename In >
static Uint32 sf::Utf< 32 >::DecodeAnsi ( In  input,
const std::locale &  locale = GetDefaultLocale() 
) [inline, static]

Decode a single ANSI character to UTF-32.

This function does not exist in other specializations of sf::Utf<>, it is defined for convenience (it is used by several other conversion functions).

Parameters:
input Input ANSI character
locale Locale to use for conversion
Returns:
Converted character
template<typename In >
static Uint32 sf::Utf< 32 >::DecodeWide ( In  input  )  [inline, static]

Decode a single wide character to UTF-32.

This function does not exist in other specializations of sf::Utf<>, it is defined for convenience (it is used by several other conversion functions).

Parameters:
input Input wide character
Returns:
Converted character
template<typename Out >
static Out sf::Utf< 32 >::Encode ( Uint32  input,
Out  output,
Uint32  replacement = 0 
) [inline, static]

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.

Parameters:
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)
Returns:
Iterator to the end of the output sequence which has been written
template<typename Out >
static Out sf::Utf< 32 >::EncodeAnsi ( Uint32  codepoint,
Out  output,
char  replacement = 0,
const std::locale &  locale = GetDefaultLocale() 
) [inline, static]

Encode a single UTF-32 character to ANSI.

This function does not exist in other specializations of sf::Utf<>, it is defined for convenience (it is used by several other conversion functions).

Parameters:
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
Returns:
Iterator to the end of the output sequence which has been written
template<typename Out >
static Out sf::Utf< 32 >::EncodeWide ( Uint32  codepoint,
Out  output,
wchar_t  replacement = 0 
) [inline, static]

Encode a single UTF-32 character to wide.

This function does not exist in other specializations of sf::Utf<>, it is defined for convenience (it is used by several other conversion functions).

Parameters:
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)
Returns:
Iterator to the end of the output sequence which has been written
template<typename In , typename Out >
static Out sf::Utf< 32 >::FromAnsi ( In  begin,
In  end,
Out  output,
const std::locale &  locale = GetDefaultLocale() 
) [inline, static]

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.

Parameters:
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
Returns:
Iterator to the end of the output sequence which has been written
template<typename In , typename Out >
static Out sf::Utf< 32 >::FromWide ( In  begin,
In  end,
Out  output 
) [inline, static]

Convert a wide characters range to UTF-32.

Parameters:
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
Returns:
Iterator to the end of the output sequence which has been written
template<typename In >
static In sf::Utf< 32 >::Next ( In  begin,
In  end 
) [inline, static]

Advance to the next UTF-32 character.

This function is trivial for UTF-32, which can store every character in a single storage element.

Parameters:
begin Iterator pointing to the beginning of the input sequence
end Iterator pointing to the end of the input sequence
Returns:
Iterator pointing to one past the last read element of the input sequence
template<typename In , typename Out >
static Out sf::Utf< 32 >::ToAnsi ( In  begin,
In  end,
Out  output,
char  replacement = 0,
const std::locale &  locale = GetDefaultLocale() 
) [inline, static]

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.

Parameters:
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
Returns:
Iterator to the end of the output sequence which has been written
template<typename In , typename Out >
static Out sf::Utf< 32 >::ToUtf16 ( In  begin,
In  end,
Out  output 
) [inline, static]

Convert a UTF-32 characters range to UTF-16.

Parameters:
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
Returns:
Iterator to the end of the output sequence which has been written
template<typename In , typename Out >
static Out sf::Utf< 32 >::ToUtf32 ( In  begin,
In  end,
Out  output 
) [inline, static]

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 sf::Utf<> template, and allow generic code to be written on top of it.

Parameters:
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
Returns:
Iterator to the end of the output sequence which has been written
template<typename In , typename Out >
static Out sf::Utf< 32 >::ToUtf8 ( In  begin,
In  end,
Out  output 
) [inline, static]

Convert a UTF-32 characters range to UTF-8.

Parameters:
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
Returns:
Iterator to the end of the output sequence which has been written
template<typename In , typename Out >
static Out sf::Utf< 32 >::ToWide ( In  begin,
In  end,
Out  output,
wchar_t  replacement = 0 
) [inline, static]

Convert an UTF-32 characters range to wide characters.

Parameters:
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)
Returns:
Iterator to the end of the output sequence which has been written

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