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

#include <string_conv.h>

Public Member Functions

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

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_codepage_from_wide_t< t_alloc >

Definition at line 382 of file string_conv.h.

Constructor & Destructor Documentation

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

Definition at line 384 of file string_conv.h.

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

Definition at line 385 of file string_conv.h.

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

Definition at line 386 of file string_conv.h.

386 {convert(p_codepage,p_source,p_source_size);}
void convert(unsigned p_codepage, const wchar_t *p_source, t_size p_source_size=~0)
Definition: string_conv.h:388

Member Function Documentation

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

Definition at line 388 of file string_conv.h.

388  {
389  t_size size = estimate_wide_to_codepage(p_codepage,p_source,p_source_size);
390  m_buffer.set_size(size);
391  convert_wide_to_codepage(p_codepage, m_buffer.get_ptr_var(),size,p_source,p_source_size);
392  }
char_buffer_t< char, t_alloc > m_buffer
Definition: string_conv.h:400
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
template<template< typename t_allocitem > class t_alloc = pfc::alloc_standard>
const char* pfc::stringcvt::string_codepage_from_wide_t< t_alloc >::get_ptr ( ) const
inline

Definition at line 395 of file string_conv.h.

395 {return m_buffer.get_ptr();}
char_buffer_t< char, t_alloc > m_buffer
Definition: string_conv.h:400
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_codepage_from_wide_t< t_alloc >::is_empty ( ) const
inline

Definition at line 396 of file string_conv.h.

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

Definition at line 397 of file string_conv.h.

397 {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_codepage_from_wide_t< t_alloc >::operator const char * ( ) const
inline

Definition at line 394 of file string_conv.h.

394 {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_codepage_from_wide_t< t_alloc >::m_buffer
private

Definition at line 400 of file string_conv.h.


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