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

#include <string_base.h>

Public Member Functions

 string_extension (const char *src)
 
const char * get_ptr () const
 
t_size length () const
 
 operator const char * () const
 
const char * toString () const
 

Private Attributes

char buffer [32]
 

Detailed Description

Definition at line 511 of file string_base.h.

Constructor & Destructor Documentation

pfc::string_extension::string_extension ( const char *  src)
explicit

Definition at line 109 of file string_base.cpp.

110 {
111  buffer[0]=0;
112  const char * start = src + pfc::scan_filename(src);
113  const char * end = start + strlen(start);
114  const char * ptr = end-1;
115  while(ptr>start && *ptr!='.')
116  {
117  if (*ptr=='?') end=ptr;
118  ptr--;
119  }
120 
121  if (ptr>=start && *ptr=='.')
122  {
123  ptr++;
124  t_size len = end-ptr;
125  if (len<PFC_TABSIZE(buffer))
126  {
127  memcpy(buffer,ptr,len*sizeof(char));
128  buffer[len]=0;
129  }
130  }
131 }
size_t t_size
Definition: int_types.h:48
t_size scan_filename(const char *ptr)

Member Function Documentation

const char* pfc::string_extension::get_ptr ( ) const
inline

Definition at line 515 of file string_base.h.

515 {return buffer;}
t_size pfc::string_extension::length ( ) const
inline

Definition at line 516 of file string_base.h.

516 {return strlen(buffer);}
pfc::string_extension::operator const char * ( ) const
inline

Definition at line 517 of file string_base.h.

517 {return buffer;}
const char* pfc::string_extension::toString ( ) const
inline

Definition at line 518 of file string_base.h.

518 {return buffer;}

Field Documentation

char pfc::string_extension::buffer[32]
private

Definition at line 513 of file string_base.h.


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