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

#include <string_conv.h>

Public Member Functions

 string_codepage_from_utf8 ()
 
 string_codepage_from_utf8 (const string_codepage_from_utf8 &p_source)
 
 string_codepage_from_utf8 (unsigned p_codepage, const char *p_source, t_size p_source_size=~0)
 
void convert (unsigned p_codepage, 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 > m_buffer
 

Detailed Description

Definition at line 404 of file string_conv.h.

Constructor & Destructor Documentation

pfc::stringcvt::string_codepage_from_utf8::string_codepage_from_utf8 ( )
inline

Definition at line 406 of file string_conv.h.

406 {}
pfc::stringcvt::string_codepage_from_utf8::string_codepage_from_utf8 ( const string_codepage_from_utf8 p_source)
inline

Definition at line 407 of file string_conv.h.

407 : m_buffer(p_source.m_buffer) {}
pfc::stringcvt::string_codepage_from_utf8::string_codepage_from_utf8 ( unsigned  p_codepage,
const char *  p_source,
t_size  p_source_size = ~0 
)
inline

Definition at line 408 of file string_conv.h.

408 {convert(p_codepage,p_source,p_source_size);}
void convert(unsigned p_codepage, const char *p_source, t_size p_source_size=~0)
Definition: string_conv.h:410

Member Function Documentation

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

Definition at line 410 of file string_conv.h.

410  {
412  temp.convert(p_source,p_source_size);
413  t_size size = estimate_wide_to_codepage(p_codepage,temp,~0);
414  m_buffer.set_size(size);
415  convert_wide_to_codepage(p_codepage,m_buffer.get_ptr_var(),size,temp,~0);
416  }
void convert(const char *p_source, t_size p_source_size)
Definition: string_conv.h:122
string_wide_from_utf8_t string_wide_from_utf8
Definition: string_conv.h:160
size_t t_size
Definition: int_types.h:48
t_size convert_wide_to_codepage(unsigned p_codepage, char *p_out, t_size p_out_size, const wchar_t *p_source, t_size p_source_size)
Converts string from wide character to specified codepage.
t_size estimate_wide_to_codepage(unsigned p_codepage, const wchar_t *p_source, t_size p_source_size)
Estimates buffer size required to convert specified wide character string to specified codepage...
void set_size(t_size p_count)
Definition: string_conv.h:83
const char* pfc::stringcvt::string_codepage_from_utf8::get_ptr ( ) const
inline

Definition at line 419 of file string_conv.h.

419 {return m_buffer.get_ptr();}
const t_char * get_ptr() const
Definition: string_conv.h:85
bool pfc::stringcvt::string_codepage_from_utf8::is_empty ( ) const
inline

Definition at line 420 of file string_conv.h.

420 {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_codepage_from_utf8::length ( ) const
inline

Definition at line 421 of file string_conv.h.

421 {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_codepage_from_utf8::operator const char * ( ) const
inline

Definition at line 418 of file string_conv.h.

418 {return get_ptr();}

Field Documentation

char_buffer_t<char> pfc::stringcvt::string_codepage_from_utf8::m_buffer
private

Definition at line 424 of file string_conv.h.


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