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

#include <string_base.h>

Public Member Functions

 string_replace_extension (const char *p_path, const char *p_ext)
 
 operator const char * () const
 

Private Attributes

string8 m_data
 

Detailed Description

Definition at line 523 of file string_base.h.

Constructor & Destructor Documentation

pfc::string_replace_extension::string_replace_extension ( const char *  p_path,
const char *  p_ext 
)

Definition at line 668 of file string_base.cpp.

669 {
670  m_data = p_path;
671  t_size dot = m_data.find_last('.');
672  if (dot < m_data.scan_filename())
673  {//argh
674  m_data += ".";
675  m_data += p_ext;
676  }
677  else
678  {
679  m_data.truncate(dot+1);
680  m_data += p_ext;
681  }
682 }
t_size find_last(char p_char, t_size p_start=~0) const
Definition: string_base.h:238
void truncate(t_size len)
Definition: string_base.h:390
t_size scan_filename() const
Definition: string_base.h:235
size_t t_size
Definition: int_types.h:48

Member Function Documentation

pfc::string_replace_extension::operator const char * ( ) const
inline

Definition at line 527 of file string_base.h.

527 {return m_data;}

Field Documentation

string8 pfc::string_replace_extension::m_data
private

Definition at line 529 of file string_base.h.


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