#include <hikogui/char_maps/char_converter.hpp>
|
using | from_encoder_type = char_map<From> |
|
using | to_encoder_type = char_map<To> |
|
using | from_char_type = from_encoder_type::char_type |
|
using | to_char_type = to_encoder_type::char_type |
|
using | from_string_type = std::basic_string<from_char_type> |
|
using | to_string_type = std::basic_string<to_char_type> |
|
|
template<typename OutRange , typename InRange > |
constexpr OutRange | convert (InRange &&src) const noexcept |
| Convert text between the given encodings.
|
|
template<typename OutRange , typename It , typename EndIt > |
constexpr OutRange | convert (It first, EndIt last) const noexcept |
| Convert text between the given encodings.
|
|
template<typename OutRange = std::basic_string<to_char_type>> |
OutRange | read (void const *ptr, size_t size, std::endian endian=std::endian::native) noexcept |
| Read text from a byte array.
|
|
template<typename InRange > |
constexpr to_string_type | operator() (InRange &&src) const noexcept |
| Convert text between the given encodings.
|
|
A converter between character encodings.
- Template Parameters
-
From | a string-tag matching an existing char_map<From> |
To | a string-tag matching an existing char_map<To> |
◆ convert() [1/2]
template<typename OutRange , typename InRange >
Convert text between the given encodings.
- Template Parameters
-
- Parameters
-
src | The text to be converted. |
- Returns
- The converted text.
◆ convert() [2/2]
template<typename OutRange , typename It , typename EndIt >
Convert text between the given encodings.
- Template Parameters
-
- Parameters
-
first | An iterator pointing to the first character to be converted. |
last | An iterator pointing one beyond the last character to be converted, or a sentinel. |
- Returns
- The converted text.
◆ operator()()
template<typename InRange >
Convert text between the given encodings.
- Parameters
-
src | The text to be converted. |
- Returns
- The converted text as a std::basic_string<to_char_type>.
◆ read()
template<typename OutRange = std::basic_string<to_char_type>>
OutRange hi::v1::char_converter< From, To >::read |
( |
void const * | ptr, |
|
|
size_t | size, |
|
|
std::endian | endian = std::endian::native ) |
|
inlinenoexcept |
Read text from a byte array.
- Template Parameters
-
- Parameters
-
ptr | A pointer to a byte array containing the text in the From encoding. |
size | The number of bytes in the array. |
endian | The endianness of characters in the array, used as a hint. |
- Returns
- The converted text.
The documentation for this struct was generated from the following file: