foobar2000 SDK  2015-01-14
Public Member Functions | Private Attributes
pfc::stringcvt::string_utf8_from_wide_t< t_alloc >

#include <string_conv.h>

Public Member Functions

 string_utf8_from_wide_t ()
 
 string_utf8_from_wide_t (const wchar_t *p_source, t_size p_source_size=~0)
 
void convert (const wchar_t *p_source, t_size p_source_size=~0)
 
const char * get_ptr () const
 
bool is_empty () const
 
t_size length () const
 
 operator const char * () const
 
const char * toString () const
 

Private Attributes

char_buffer_t< char, t_alloc > m_buffer
 

Detailed Description

template<template< typename t_allocitem > class t_alloc = pfc::alloc_standard>
class pfc::stringcvt::string_utf8_from_wide_t< t_alloc >

Definition at line 93 of file string_conv.h.

Constructor & Destructor Documentation

template<template< typename t_allocitem > class t_alloc = pfc::alloc_standard>
pfc::stringcvt::string_utf8_from_wide_t< t_alloc >::string_utf8_from_wide_t ( )
inline

Definition at line 95 of file string_conv.h.

95 {}
template<template< typename t_allocitem > class t_alloc = pfc::alloc_standard>
pfc::stringcvt::string_utf8_from_wide_t< t_alloc >::string_utf8_from_wide_t ( const wchar_t *  p_source,
t_size  p_source_size = ~0 
)
inline

Definition at line 96 of file string_conv.h.

96 {convert(p_source,p_source_size);}
void convert(const wchar_t *p_source, t_size p_source_size=~0)
Definition: string_conv.h:98

Member Function Documentation

template<template< typename t_allocitem > class t_alloc = pfc::alloc_standard>
void pfc::stringcvt::string_utf8_from_wide_t< t_alloc >::convert ( const wchar_t *  p_source,
t_size  p_source_size = ~0 
)
inline

Definition at line 98 of file string_conv.h.

98  {
99  t_size size = estimate_wide_to_utf8(p_source,p_source_size);
100  m_buffer.set_size(size);
101  convert_wide_to_utf8( m_buffer.get_ptr_var(),size,p_source,p_source_size);
102  }
t_size convert_wide_to_utf8(char *p_out, t_size p_out_size, const wchar_t *p_in, t_size p_in_size)
Converts wide character string to UTF-8.
t_size estimate_wide_to_utf8(const wchar_t *p_in, t_size p_in_size)
Estimates buffer size required to convert specified wide character string to UTF-8.
char_buffer_t< char, t_alloc > m_buffer
Definition: string_conv.h:111
size_t t_size
Definition: int_types.h:48
void set_size(t_size p_count)
Definition: string_conv.h:83
template<template< typename t_allocitem > class t_alloc = pfc::alloc_standard>
const char* pfc::stringcvt::string_utf8_from_wide_t< t_alloc >::get_ptr ( ) const
inline

Definition at line 105 of file string_conv.h.

105 {return m_buffer.get_ptr();}
const t_char * get_ptr() const
Definition: string_conv.h:85
char_buffer_t< char, t_alloc > m_buffer
Definition: string_conv.h:111
template<template< typename t_allocitem > class t_alloc = pfc::alloc_standard>
bool pfc::stringcvt::string_utf8_from_wide_t< t_alloc >::is_empty ( ) const
inline

Definition at line 107 of file string_conv.h.

107 {return string_is_empty_t(get_ptr());}
bool string_is_empty_t(const t_char *p_string, t_size p_string_size=~0)
Definition: string_conv.h:74
template<template< typename t_allocitem > class t_alloc = pfc::alloc_standard>
t_size pfc::stringcvt::string_utf8_from_wide_t< t_alloc >::length ( ) const
inline

Definition at line 108 of file string_conv.h.

108 {return strlen_t(get_ptr());}
t_size strlen_t(const t_char *p_string, t_size p_string_size=~0)
Definition: string_conv.h:67
template<template< typename t_allocitem > class t_alloc = pfc::alloc_standard>
pfc::stringcvt::string_utf8_from_wide_t< t_alloc >::operator const char * ( ) const
inline

Definition at line 104 of file string_conv.h.

104 {return get_ptr();}
template<template< typename t_allocitem > class t_alloc = pfc::alloc_standard>
const char* pfc::stringcvt::string_utf8_from_wide_t< t_alloc >::toString ( ) const
inline

Definition at line 106 of file string_conv.h.

106 {return get_ptr();}

Field Documentation

template<template< typename t_allocitem > class t_alloc = pfc::alloc_standard>
char_buffer_t<char,t_alloc> pfc::stringcvt::string_utf8_from_wide_t< t_alloc >::m_buffer
private

Definition at line 111 of file string_conv.h.


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