foobar2000 SDK  2015-08-03
Public Member Functions | Private Attributes
pfc::stringcvt::string_ascii_from_utf8

#include <string_conv.h>

Public Member Functions

 string_ascii_from_utf8 ()
 
 string_ascii_from_utf8 (const char *p_source, t_size p_source_size=~0)
 
void convert (const char *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
 

Private Attributes

char_buffer_t< char, pfc::alloc_fast_aggressivem_buffer
 

Detailed Description

Definition at line 255 of file string_conv.h.

Constructor & Destructor Documentation

pfc::stringcvt::string_ascii_from_utf8::string_ascii_from_utf8 ( )
inline

Definition at line 257 of file string_conv.h.

257 {}
pfc::stringcvt::string_ascii_from_utf8::string_ascii_from_utf8 ( const char *  p_source,
t_size  p_source_size = ~0 
)
inline

Definition at line 258 of file string_conv.h.

258 { convert(p_source, p_source_size); }
void convert(const char *p_source, t_size p_source_size=~0)
Definition: string_conv.h:260

Member Function Documentation

void pfc::stringcvt::string_ascii_from_utf8::convert ( const char *  p_source,
t_size  p_source_size = ~0 
)
inline

Definition at line 260 of file string_conv.h.

260  {
261  t_size size = estimate_utf8_to_ascii(p_source, p_source_size);
262  m_buffer.set_size(size);
263  convert_utf8_to_ascii(m_buffer.get_ptr_var(), size, p_source, p_source_size);
264  }
t_size estimate_utf8_to_ascii(const char *p_source, t_size p_source_size)
char_buffer_t< char, pfc::alloc_fast_aggressive > m_buffer
Definition: string_conv.h:272
size_t t_size
Definition: int_types.h:48
t_size convert_utf8_to_ascii(char *p_out, t_size p_out_size, const char *p_in, t_size p_in_size)
const char* pfc::stringcvt::string_ascii_from_utf8::get_ptr ( ) const
inline

Definition at line 267 of file string_conv.h.

267 {return m_buffer.get_ptr();}
char_buffer_t< char, pfc::alloc_fast_aggressive > m_buffer
Definition: string_conv.h:272
bool pfc::stringcvt::string_ascii_from_utf8::is_empty ( ) const
inline

Definition at line 268 of file string_conv.h.

268 {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
t_size pfc::stringcvt::string_ascii_from_utf8::length ( ) const
inline

Definition at line 269 of file string_conv.h.

269 {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
pfc::stringcvt::string_ascii_from_utf8::operator const char * ( ) const
inline

Definition at line 266 of file string_conv.h.

266 {return get_ptr();}

Field Documentation

char_buffer_t<char, pfc::alloc_fast_aggressive> pfc::stringcvt::string_ascii_from_utf8::m_buffer
private

Definition at line 272 of file string_conv.h.


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