Documentation of SFML 2.6.0

Warning: this page refers to an old version of SFML. Click here to switch to the latest version.
Loading...
Searching...
No Matches
sf::Utf< 32 > Class Reference

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

#include <SFML/System/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-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=std::locale())
 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 fromLatin1 (In begin, In end, Out output)
 Convert a latin-1 (ISO-5589-1) 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=std::locale())
 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 toLatin1 (In begin, In end, Out output, char replacement=0)
 Convert an UTF-16 characters range to latin-1 (ISO-5589-1) 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=std::locale())
 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=std::locale())
 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

Specialization of the Utf template for UTF-32.

Definition at line 462 of file Utf.hpp.

Member Function Documentation

◆ count()

template<typename In >
static std::size_t sf::Utf< 32 >::count ( In  begin,
In  end 
)
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
beginIterator pointing to the beginning of the input sequence
endIterator pointing to the end of the input sequence
Returns
Iterator pointing to one past the last read element of the input sequence

◆ decode()

template<typename In >
static In sf::Utf< 32 >::decode ( In  begin,
In  end,
Uint32 &  output,
Uint32  replacement = 0 
)
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
beginIterator pointing to the beginning of the input sequence
endIterator pointing to the end of the input sequence
outputCodepoint of the decoded UTF-32 character
replacementReplacement 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

◆ decodeAnsi()

template<typename In >
static Uint32 sf::Utf< 32 >::decodeAnsi ( In  input,
const std::locale &  locale = std::locale() 
)
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
inputInput ANSI character
localeLocale to use for conversion
Returns
Converted character

◆ decodeWide()

template<typename In >
static Uint32 sf::Utf< 32 >::decodeWide ( In  input)
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
inputInput wide character
Returns
Converted character

◆ encode()

template<typename Out >
static Out sf::Utf< 32 >::encode ( Uint32  input,
Out  output,
Uint32  replacement = 0 
)
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
inputCodepoint to encode as UTF-32
outputIterator pointing to the beginning of the output sequence
replacementReplacement 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

◆ encodeAnsi()

template<typename Out >
static Out sf::Utf< 32 >::encodeAnsi ( Uint32  codepoint,
Out  output,
char  replacement = 0,
const std::locale &  locale = std::locale() 
)
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
codepointIterator pointing to the beginning of the input sequence
outputIterator pointing to the beginning of the output sequence
replacementReplacement if the input character is not convertible to ANSI (use 0 to skip it)
localeLocale to use for conversion
Returns
Iterator to the end of the output sequence which has been written

◆ encodeWide()

template<typename Out >
static Out sf::Utf< 32 >::encodeWide ( Uint32  codepoint,
Out  output,
wchar_t  replacement = 0 
)
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
codepointIterator pointing to the beginning of the input sequence
outputIterator pointing to the beginning of the output sequence
replacementReplacement 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

◆ fromAnsi()

template<typename In , typename Out >
static Out sf::Utf< 32 >::fromAnsi ( In  begin,
In  end,
Out  output,
const std::locale &  locale = std::locale() 
)
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
beginIterator pointing to the beginning of the input sequence
endIterator pointing to the end of the input sequence
outputIterator pointing to the beginning of the output sequence
localeLocale to use for conversion
Returns
Iterator to the end of the output sequence which has been written

◆ fromLatin1()

template<typename In , typename Out >
static Out sf::Utf< 32 >::fromLatin1 ( In  begin,
In  end,
Out  output 
)
static

Convert a latin-1 (ISO-5589-1) characters range to UTF-32.

Parameters
beginIterator pointing to the beginning of the input sequence
endIterator pointing to the end of the input sequence
outputIterator pointing to the beginning of the output sequence
Returns
Iterator to the end of the output sequence which has been written

◆ fromWide()

template<typename In , typename Out >
static Out sf::Utf< 32 >::fromWide ( In  begin,
In  end,
Out  output 
)
static

Convert a wide characters range to UTF-32.

Parameters
beginIterator pointing to the beginning of the input sequence
endIterator pointing to the end of the input sequence
outputIterator pointing to the beginning of the output sequence
Returns
Iterator to the end of the output sequence which has been written

◆ next()

template<typename In >
static In sf::Utf< 32 >::next ( In  begin,
In  end 
)
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
beginIterator pointing to the beginning of the input sequence
endIterator pointing to the end of the input sequence
Returns
Iterator pointing to one past the last read element of the input sequence

◆ toAnsi()

template<typename In , typename Out >
static Out sf::Utf< 32 >::toAnsi ( In  begin,
In  end,
Out  output,
char  replacement = 0,
const std::locale &  locale = std::locale() 
)
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
beginIterator pointing to the beginning of the input sequence
endIterator pointing to the end of the input sequence
outputIterator pointing to the beginning of the output sequence
replacementReplacement for characters not convertible to ANSI (use 0 to skip them)
localeLocale to use for conversion
Returns
Iterator to the end of the output sequence which has been written

◆ toLatin1()

template<typename In , typename Out >
static Out sf::Utf< 32 >::toLatin1 ( In  begin,
In  end,
Out  output,
char  replacement = 0 
)
static

Convert an UTF-16 characters range to latin-1 (ISO-5589-1) characters.

Parameters
beginIterator pointing to the beginning of the input sequence
endIterator pointing to the end of the input sequence
outputIterator pointing to the beginning of the output sequence
replacementReplacement for characters not convertible to wide (use 0 to skip them)
Returns
Iterator to the end of the output sequence which has been written

◆ toUtf16()

template<typename In , typename Out >
static Out sf::Utf< 32 >::toUtf16 ( In  begin,
In  end,
Out  output 
)
static

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

Parameters
beginIterator pointing to the beginning of the input sequence
endIterator pointing to the end of the input sequence
outputIterator pointing to the beginning of the output sequence
Returns
Iterator to the end of the output sequence which has been written

◆ toUtf32()

template<typename In , typename Out >
static Out sf::Utf< 32 >::toUtf32 ( In  begin,
In  end,
Out  output 
)
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
beginIterator pointing to the beginning of the input sequence
endIterator pointing to the end of the input sequence
outputIterator pointing to the beginning of the output sequence
Returns
Iterator to the end of the output sequence which has been written

◆ toUtf8()

template<typename In , typename Out >
static Out sf::Utf< 32 >::toUtf8 ( In  begin,
In  end,
Out  output 
)
static

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

Parameters
beginIterator pointing to the beginning of the input sequence
endIterator pointing to the end of the input sequence
outputIterator pointing to the beginning of the output sequence
Returns
Iterator to the end of the output sequence which has been written

◆ toWide()

template<typename In , typename Out >
static Out sf::Utf< 32 >::toWide ( In  begin,
In  end,
Out  output,
wchar_t  replacement = 0 
)
static

Convert an UTF-32 characters range to wide characters.

Parameters
beginIterator pointing to the beginning of the input sequence
endIterator pointing to the end of the input sequence
outputIterator pointing to the beginning of the output sequence
replacementReplacement 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: