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

#include <stringNew.h>

Public Member Functions

 stringp (const char *ptr)
 
 stringp (string const &s)
 
 stringp (string_base const &s)
 
template<typename TWhat >
 stringp (const TWhat &in)
 
const char * c_str () const
 
const char * get_ptr () const
 
t_size length () const
 
 operator const char * () const
 
 operator string () const
 
const char * ptr () const
 
string str () const
 
string toString () const
 

Private Attributes

const char *const m_ptr
 
string::t_data m_s
 

Detailed Description

"String parameter" helper class, to use in function parameters, allowing functions to take any type of string as a parameter (const char*, string_base, string).

Definition at line 224 of file stringNew.h.

Constructor & Destructor Documentation

pfc::stringp::stringp ( const char *  ptr)
inline

Definition at line 226 of file stringNew.h.

226 : m_ptr(ptr) {}
const char *const m_ptr
Definition: stringNew.h:240
const char * ptr() const
Definition: stringNew.h:232
pfc::stringp::stringp ( string const &  s)
inline

Definition at line 227 of file stringNew.h.

227 : m_ptr(s.ptr()), m_s(s._content()) {}
const char *const m_ptr
Definition: stringNew.h:240
string::t_data m_s
Definition: stringNew.h:241
pfc::stringp::stringp ( string_base const &  s)
inline

Definition at line 228 of file stringNew.h.

228 : m_ptr(s.get_ptr()) {}
const char *const m_ptr
Definition: stringNew.h:240
template<typename TWhat >
pfc::stringp::stringp ( const TWhat &  in)
inline

Definition at line 229 of file stringNew.h.

229 : m_ptr(in.toString()) {}
const char *const m_ptr
Definition: stringNew.h:240

Member Function Documentation

const char* pfc::stringp::c_str ( ) const
inline

Definition at line 238 of file stringNew.h.

238 { return ptr(); }
const char * ptr() const
Definition: stringNew.h:232
const char* pfc::stringp::get_ptr ( ) const
inline

Definition at line 233 of file stringNew.h.

233 {return m_ptr;}
const char *const m_ptr
Definition: stringNew.h:240
t_size pfc::stringp::length ( ) const
inline

Definition at line 237 of file stringNew.h.

237 {return m_s.is_valid() ? m_s->length() : strlen(m_ptr);}
const char *const m_ptr
Definition: stringNew.h:240
string::t_data m_s
Definition: stringNew.h:241
bool is_valid() const
Definition: rcptr.h:80
t_size length() const
For compatibility with old conventions.
Definition: string_base.h:209
pfc::stringp::operator const char * ( ) const
inline

Definition at line 231 of file stringNew.h.

231 {return m_ptr;}
const char *const m_ptr
Definition: stringNew.h:240
pfc::stringp::operator string ( ) const
inline

Definition at line 235 of file stringNew.h.

235 {return str();}
string str() const
Definition: stringNew.h:234
const char* pfc::stringp::ptr ( ) const
inline

Definition at line 232 of file stringNew.h.

232 {return m_ptr;}
const char *const m_ptr
Definition: stringNew.h:240
string pfc::stringp::str ( ) const
inline

Definition at line 234 of file stringNew.h.

234 {return m_s.is_valid() ? string(m_s) : string(m_ptr);}
const char *const m_ptr
Definition: stringNew.h:240
string::t_data m_s
Definition: stringNew.h:241
bool is_valid() const
Definition: rcptr.h:80
string pfc::stringp::toString ( ) const
inline

Definition at line 236 of file stringNew.h.

236 {return str();}
string str() const
Definition: stringNew.h:234

Field Documentation

const char* const pfc::stringp::m_ptr
private

Definition at line 240 of file stringNew.h.

string::t_data pfc::stringp::m_s
private

Definition at line 241 of file stringNew.h.


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