31 #ifndef PTLIB_WXSTRING_H
32 #define PTLIB_WXSTRING_H
42 PwxString(
const char * str) : wxString( str, wxConvUTF8) { }
45 #ifdef OPAL_OPAL_MEDIAFMT_H
46 PwxString(
const OpalMediaFormat & fmt) : wxString((const char *)fmt.GetName(), wxConvUTF8) { }
49 PwxString(
const wchar_t * wstr) : wxString(wstr) { }
52 inline PwxString &
operator=(
const char * str) { *
this = wxString(str, wxConvUTF8);
return *
this; }
54 inline PwxString &
operator=(
const wchar_t * wstr) { wxString::operator=(wstr);
return *
this; }
59 inline bool operator==(
const char * other)
const {
return IsSameAs(wxString(other, wxConvUTF8)); }
61 inline bool operator==(
const wchar_t * other)
const {
return IsSameAs(other); }
63 inline bool operator==(
const wxString & other)
const {
return IsSameAs(other); }
64 inline bool operator==(
const PString & other)
const {
return IsSameAs(wxString((
const char *)other, wxConvUTF8)); }
66 #ifdef OPAL_OPAL_MEDIAFMT_H
67 inline bool operator==(
const OpalMediaFormat & other)
const {
return IsSameAs(wxString((
const char *)other.GetName(), wxConvUTF8)); }
70 inline bool operator!=(
const char * other)
const {
return !IsSameAs(wxString(other, wxConvUTF8)); }
72 inline bool operator!=(
const wchar_t * other)
const {
return !IsSameAs(other); }
74 inline bool operator!=(
const wxString & other)
const {
return !IsSameAs(other); }
75 inline bool operator!=(
const PString & other)
const {
return !IsSameAs(wxString((
const char *)other, wxConvUTF8)); }
77 #ifdef OPAL_OPAL_MEDIAFMT_H
78 inline bool operator!=(
const OpalMediaFormat & other)
const {
return !IsSameAs(wxString((
const char *)other.GetName(), wxConvUTF8)); }
83 inline operator PString()
const {
return ToUTF8().data(); }
85 inline operator PFilePath()
const {
return ToUTF8().data(); }
86 #if defined(PTLIB_PURL_H) && defined(P_URL)
87 inline operator PURL()
const {
return ToUTF8().data(); }
89 #if defined(PTLIB_IPSOCKET_H)
92 inline friend ostream &
operator<<(ostream & stream,
const PwxString &
string) {
return stream <<
string.ToUTF8(); }
93 inline friend wostream &
operator<<(wostream & stream,
const PwxString &
string) {
return stream <<
string.c_str(); }
96 inline operator PString()
const {
return c_str(); }
98 inline operator PFilePath()
const {
return c_str(); }
99 #if defined(PTLIB_PURL_H) && defined(P_URL)
100 inline operator PURL()
const {
return c_str(); }
102 #if defined(PTLIB_IPSOCKET_H)
105 inline friend ostream &
operator<<(ostream & stream,
const PwxString &
string) {
return stream <<
string.c_str(); }
106 inline friend wostream &
operator<<(wostream & stream,
const PwxString &
string) {
return stream <<
string.c_str(); }
109 #if !wxCHECK_VERSION(2,9,2)
118 #endif // PTLIB_WXSTRING_H