foobar2000 SDK  2015-08-03
Public Member Functions | Private Attributes
pfc::format_pad_right< t_stringbuffer >

#include <string_base.h>

Public Member Functions

 format_pad_right (t_size p_chars, t_uint32 p_padding, const char *p_string, t_size p_string_length=~0)
 
const char * get_ptr () const
 
 operator const char * () const
 
const char * toString () const
 

Private Attributes

t_stringbuffer m_buffer
 

Detailed Description

template<typename t_stringbuffer = pfc::string8_fastalloc>
class pfc::format_pad_right< t_stringbuffer >

Definition at line 689 of file string_base.h.

Constructor & Destructor Documentation

template<typename t_stringbuffer = pfc::string8_fastalloc>
pfc::format_pad_right< t_stringbuffer >::format_pad_right ( t_size  p_chars,
t_uint32  p_padding,
const char *  p_string,
t_size  p_string_length = ~0 
)
inline

Definition at line 691 of file string_base.h.

691  {
692  t_size source_len = 0, source_walk = 0;
693 
694  while(source_walk < p_string_length && source_len < p_chars) {
695  unsigned dummy;
696  t_size delta = pfc::utf8_decode_char(p_string + source_walk, dummy, p_string_length - source_walk);
697  if (delta == 0) break;
698  source_len++;
699  source_walk += delta;
700  }
701 
702  m_buffer.add_chars(p_padding,p_chars - source_len);
703  m_buffer.add_string(p_string,source_walk);
704  }
t_stringbuffer m_buffer
Definition: string_base.h:709
size_t t_size
Definition: int_types.h:48
t_size utf8_decode_char(const char *src, unsigned &out, t_size src_bytes)
Definition: utf8.cpp:64

Member Function Documentation

template<typename t_stringbuffer = pfc::string8_fastalloc>
const char* pfc::format_pad_right< t_stringbuffer >::get_ptr ( ) const
inline

Definition at line 705 of file string_base.h.

705 {return m_buffer;}
t_stringbuffer m_buffer
Definition: string_base.h:709
template<typename t_stringbuffer = pfc::string8_fastalloc>
pfc::format_pad_right< t_stringbuffer >::operator const char * ( ) const
inline

Definition at line 706 of file string_base.h.

706 {return m_buffer;}
t_stringbuffer m_buffer
Definition: string_base.h:709
template<typename t_stringbuffer = pfc::string8_fastalloc>
const char* pfc::format_pad_right< t_stringbuffer >::toString ( ) const
inline

Definition at line 707 of file string_base.h.

707 {return m_buffer;}
t_stringbuffer m_buffer
Definition: string_base.h:709

Field Documentation

template<typename t_stringbuffer = pfc::string8_fastalloc>
t_stringbuffer pfc::format_pad_right< t_stringbuffer >::m_buffer
private

Definition at line 709 of file string_base.h.


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