stdex
Additional custom or not Standard C++ covered algorithms
Loading...
Searching...
No Matches
stdex::charset_encoder< T_from, T_to > Class Template Reference

Encoding converter context. More...

#include <stdex/unicode.hpp>

Public Member Functions

 charset_encoder (charset_id from, charset_id to)
 
charset_id from_encoding () const
 
charset_id to_encoding () const
 
template<class TR_to = std::char_traits<T_to>, class AX_to = std::allocator<T_to>>
void strcat (std::basic_string< T_to, TR_to, AX_to > &dst, _In_reads_or_z_opt_(count_src) const T_from *src, size_t count_src)
 Convert string and append to string.
 
template<class TR_to = std::char_traits<T_to>, class AX_to = std::allocator<T_to>>
void strcat (std::basic_string< T_to, TR_to, AX_to > &dst, const T_from *src)
 Convert string and append to string.
 
template<class TR_to = std::char_traits<T_to>, class AX_to = std::allocator<T_to>>
void strcat (std::basic_string< T_to, TR_to, AX_to > &dst, const std::basic_string_view< T_from, std::char_traits< T_from > > src)
 Convert string and append to string.
 
template<class TR_to = std::char_traits<T_to>, class AX_to = std::allocator<T_to>>
void strcpy (std::basic_string< T_to, TR_to, AX_to > &dst, _In_reads_or_z_opt_(count_src) const T_from *src, size_t count_src)
 Convert string.
 
template<class TR_to = std::char_traits<T_to>, class AX_to = std::allocator<T_to>>
void strcpy (std::basic_string< T_to, TR_to, AX_to > &dst, const T_from *src)
 Convert string.
 
template<class TR_to = std::char_traits<T_to>, class AX_to = std::allocator<T_to>>
void strcpy (std::basic_string< T_to, TR_to, AX_to > &dst, const std::basic_string_view< T_from, std::char_traits< T_from > > src)
 Convert string.
 
template<class TR_to = std::char_traits<T_to>, class AX_to = std::allocator<T_to>>
std::basic_string< T_to, TR_to, AX_to > convert (_In_reads_or_z_opt_(count_src) const T_from *src, size_t count_src)
 Return converted string.
 
template<class TR_to = std::char_traits<T_to>, class AX_to = std::allocator<T_to>>
std::basic_string< T_to, TR_to, AX_to > convert (const T_from *src)
 Return converted string.
 
template<class TR_to = std::char_traits<T_to>, class AX_to = std::allocator<T_to>>
std::basic_string< T_to, TR_to, AX_to > convert (const std::basic_string_view< T_from, std::char_traits< T_from > > src)
 Return converted string.
 
void clear ()
 

Static Public Member Functions

static charset_id system_charset ()
 

Static Protected Member Functions

static const char * to_encoding (charset_id charset)
 

Protected Attributes

charset_id m_from
 
charset_id m_to
 
iconv_t m_handle
 

Detailed Description

template<typename T_from, typename T_to>
class stdex::charset_encoder< T_from, T_to >

Encoding converter context.

Member Function Documentation

◆ convert() [1/3]

template<typename T_from , typename T_to >
template<class TR_to = std::char_traits<T_to>, class AX_to = std::allocator<T_to>>
std::basic_string< T_to, TR_to, AX_to > stdex::charset_encoder< T_from, T_to >::convert ( _In_reads_or_z_opt_(count_src) const T_from * src,
size_t count_src )
inline

Return converted string.

Parameters
[in]srcString to convert
[in]count_srcString to convert code unit limit

◆ convert() [2/3]

template<typename T_from , typename T_to >
template<class TR_to = std::char_traits<T_to>, class AX_to = std::allocator<T_to>>
std::basic_string< T_to, TR_to, AX_to > stdex::charset_encoder< T_from, T_to >::convert ( const std::basic_string_view< T_from, std::char_traits< T_from > > src)
inline

Return converted string.

Parameters
[in]srcString to convert

◆ convert() [3/3]

template<typename T_from , typename T_to >
template<class TR_to = std::char_traits<T_to>, class AX_to = std::allocator<T_to>>
std::basic_string< T_to, TR_to, AX_to > stdex::charset_encoder< T_from, T_to >::convert ( const T_from * src)
inline

Return converted string.

Parameters
[in]srcZero-terminated string to convert

◆ strcat() [1/3]

template<typename T_from , typename T_to >
template<class TR_to = std::char_traits<T_to>, class AX_to = std::allocator<T_to>>
void stdex::charset_encoder< T_from, T_to >::strcat ( std::basic_string< T_to, TR_to, AX_to > & dst,
_In_reads_or_z_opt_(count_src) const T_from * src,
size_t count_src )
inline

Convert string and append to string.

Parameters
[in,out]dstString to append converted string to
[in]srcString to convert
[in]count_srcString to convert code unit limit

◆ strcat() [2/3]

template<typename T_from , typename T_to >
template<class TR_to = std::char_traits<T_to>, class AX_to = std::allocator<T_to>>
void stdex::charset_encoder< T_from, T_to >::strcat ( std::basic_string< T_to, TR_to, AX_to > & dst,
const std::basic_string_view< T_from, std::char_traits< T_from > > src )
inline

Convert string and append to string.

Parameters
[in,out]dstString to append converted string to
[in]srcString to convert

◆ strcat() [3/3]

template<typename T_from , typename T_to >
template<class TR_to = std::char_traits<T_to>, class AX_to = std::allocator<T_to>>
void stdex::charset_encoder< T_from, T_to >::strcat ( std::basic_string< T_to, TR_to, AX_to > & dst,
const T_from * src )
inline

Convert string and append to string.

Parameters
[in,out]dstString to append converted string to
[in]srcZero-terminated string to convert

◆ strcpy() [1/3]

template<typename T_from , typename T_to >
template<class TR_to = std::char_traits<T_to>, class AX_to = std::allocator<T_to>>
void stdex::charset_encoder< T_from, T_to >::strcpy ( std::basic_string< T_to, TR_to, AX_to > & dst,
_In_reads_or_z_opt_(count_src) const T_from * src,
size_t count_src )
inline

Convert string.

Parameters
[in,out]dstString to write converted string to
[in]srcString to convert
[in]count_srcString to convert code unit limit

◆ strcpy() [2/3]

template<typename T_from , typename T_to >
template<class TR_to = std::char_traits<T_to>, class AX_to = std::allocator<T_to>>
void stdex::charset_encoder< T_from, T_to >::strcpy ( std::basic_string< T_to, TR_to, AX_to > & dst,
const std::basic_string_view< T_from, std::char_traits< T_from > > src )
inline

Convert string.

Parameters
[in,out]dstString to write converted string to
[in]srcString to convert

◆ strcpy() [3/3]

template<typename T_from , typename T_to >
template<class TR_to = std::char_traits<T_to>, class AX_to = std::allocator<T_to>>
void stdex::charset_encoder< T_from, T_to >::strcpy ( std::basic_string< T_to, TR_to, AX_to > & dst,
const T_from * src )
inline

Convert string.

Parameters
[in,out]dstString to write converted string to
[in]srcZero-terminated string to convert

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