31 #ifndef PTLIB_WXSTRING_H
32 #define PTLIB_WXSTRING_H
45 PwxString(
const char * str) : wxString( str, wxConvUTF8) { }
48 #ifdef OPAL_OPAL_MEDIAFMT_H
49 PwxString(
const OpalMediaFormat & fmt) : wxString((const char *)fmt.GetName(), wxConvUTF8) { }
52 PwxString(
const wchar_t * wstr) : wxString(wstr) { }
55 inline PwxString &
operator=(
const char * str) { *
this = wxString(str, wxConvUTF8);
return *
this; }
57 inline PwxString &
operator=(
const wchar_t * wstr) { wxString::operator=(wstr);
return *
this; }
62 inline bool operator==(
const char * other)
const {
return IsSameAs(wxString(other, wxConvUTF8)); }
64 inline bool operator==(
const wchar_t * other)
const {
return IsSameAs(other); }
66 inline bool operator==(
const wxString & other)
const {
return IsSameAs(other); }
67 inline bool operator==(
const PString & other)
const {
return IsSameAs(wxString((
const char *)other, wxConvUTF8)); }
69 #ifdef OPAL_OPAL_MEDIAFMT_H
70 inline bool operator==(
const OpalMediaFormat & other)
const {
return IsSameAs(wxString((
const char *)other.GetName(), wxConvUTF8)); }
73 inline bool operator!=(
const char * other)
const {
return !IsSameAs(wxString(other, wxConvUTF8)); }
75 inline bool operator!=(
const wchar_t * other)
const {
return !IsSameAs(other); }
77 inline bool operator!=(
const wxString & other)
const {
return !IsSameAs(other); }
78 inline bool operator!=(
const PString & other)
const {
return !IsSameAs(wxString((
const char *)other, wxConvUTF8)); }
80 #ifdef OPAL_OPAL_MEDIAFMT_H
81 inline bool operator!=(
const OpalMediaFormat & other)
const {
return !IsSameAs(wxString((
const char *)other.GetName(), wxConvUTF8)); }
86 inline operator PString()
const {
return ToUTF8().data(); }
87 inline operator PFilePath()
const {
return ToUTF8().data(); }
88 #if defined(PTLIB_PURL_H) && defined(P_URL)
89 inline operator PURL()
const {
return ToUTF8().data(); }
91 #if defined(PTLIB_IPSOCKET_H)
94 inline friend ostream &
operator<<(ostream & stream,
const PwxString &
string) {
return stream <<
string.ToUTF8(); }
95 inline friend wostream &
operator<<(wostream & stream,
const PwxString &
string) {
return stream <<
string.c_str(); }
98 inline operator PString()
const {
return c_str(); }
99 inline operator PFilePath()
const {
return c_str(); }
100 #if defined(PTLIB_PURL_H) && defined(P_URL)
101 inline operator PURL()
const {
return c_str(); }
103 #if defined(PTLIB_IPSOCKET_H)
106 inline friend ostream &
operator<<(ostream & stream,
const PwxString &
string) {
return stream <<
string.c_str(); }
107 inline friend wostream &
operator<<(wostream & stream,
const PwxString &
string) {
return stream <<
string.c_str(); }
110 #if !wxCHECK_VERSION(2,9,2)
119 #endif // PTLIB_WXSTRING_H