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

#include <string_conv.h>

Public Member Functions

 string_wide_from_codepage_t ()
 
 string_wide_from_codepage_t (const string_wide_from_codepage_t< t_alloc > &p_source)
 
 string_wide_from_codepage_t (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 wchar_t * get_ptr () const
 
bool is_empty () const
 
t_size length () const
 
 operator const wchar_t * () const
 

Private Attributes

char_buffer_t< wchar_t, t_alloc > m_buffer
 

Detailed Description

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

Definition at line 358 of file string_conv.h.

Constructor & Destructor Documentation

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

Definition at line 360 of file string_conv.h.

360 {}
template<template< typename t_allocitem > class t_alloc = pfc::alloc_standard>
pfc::stringcvt::string_wide_from_codepage_t< t_alloc >::string_wide_from_codepage_t ( const string_wide_from_codepage_t< t_alloc > &  p_source)
inline

Definition at line 361 of file string_conv.h.

361 : m_buffer(p_source.m_buffer) {}
char_buffer_t< wchar_t, t_alloc > m_buffer
Definition: string_conv.h:376
template<template< typename t_allocitem > class t_alloc = pfc::alloc_standard>
pfc::stringcvt::string_wide_from_codepage_t< t_alloc >::string_wide_from_codepage_t ( unsigned  p_codepage,
const char *  p_source,
t_size  p_source_size = ~0 
)
inline

Definition at line 362 of file string_conv.h.

362 {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:364

Member Function Documentation

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

Definition at line 364 of file string_conv.h.

364  {
365  t_size size = estimate_codepage_to_wide(p_codepage,p_source,p_source_size);
366  m_buffer.set_size(size);
367  convert_codepage_to_wide(p_codepage, m_buffer.get_ptr_var(),size,p_source,p_source_size);
368  }
t_size convert_codepage_to_wide(unsigned p_codepage, wchar_t *p_out, t_size p_out_size, const char *p_source, t_size p_source_size)
Converts string from specified codepage to wide character.
char_buffer_t< wchar_t, t_alloc > m_buffer
Definition: string_conv.h:376
t_size estimate_codepage_to_wide(unsigned p_codepage, const char *p_source, t_size p_source_size)
Estimates buffer size required to convert specified string from specified codepage to wide character...
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 wchar_t* pfc::stringcvt::string_wide_from_codepage_t< t_alloc >::get_ptr ( ) const
inline

Definition at line 371 of file string_conv.h.

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

Definition at line 372 of file string_conv.h.

372 {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_wide_from_codepage_t< t_alloc >::length ( ) const
inline

Definition at line 373 of file string_conv.h.

373 {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_wide_from_codepage_t< t_alloc >::operator const wchar_t * ( ) const
inline

Definition at line 370 of file string_conv.h.

370 {return get_ptr();}

Field Documentation

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

Definition at line 376 of file string_conv.h.


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