31 #ifndef PTLIB_WXSTRING_H
32 #define PTLIB_WXSTRING_H
47 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(); }
114 #endif // PTLIB_WXSTRING_H
This class defines a class to bridge WX Widgets strings to PTLib strings.
Definition: wxstring.h:40
PString p_str() const
Definition: wxstring.h:97
PwxString(const PFilePath &fn)
Definition: wxstring.h:46
PwxString & operator=(const wxString &str)
Definition: wxstring.h:59
PwxString(const wxString &str)
Definition: wxstring.h:44
bool operator==(const PwxString &other) const
Definition: wxstring.h:68
This class describes a full description for a file on the particular platform.
Definition: filepath.h:65
bool operator!=(const PString &other) const
Definition: wxstring.h:78
PwxString & operator=(const char *str)
Definition: wxstring.h:55
bool operator!=(const wxString &other) const
Definition: wxstring.h:77
bool operator==(const wxString &other) const
Definition: wxstring.h:66
bool operator!=(const char *other) const
Definition: wxstring.h:73
PwxString(const char *str)
Definition: wxstring.h:47
bool operator!=(const PwxString &other) const
Definition: wxstring.h:79
friend ostream & operator<<(ostream &stream, const PwxString &string)
Definition: wxstring.h:106
__inline wxString wxToString(const PwxString &str)
Definition: wxstring.h:112
PwxString & operator=(const PString &str)
Definition: wxstring.h:60
__inline bool wxFromString(wxString &s1, PwxString *&s2)
Definition: wxstring.h:111
PwxString(const PString &str)
Definition: wxstring.h:45
The character string class.
Definition: pstring.h:108
friend wostream & operator<<(wostream &stream, const PwxString &string)
Definition: wxstring.h:107
bool operator==(const PString &other) const
Definition: wxstring.h:67
A class describing an IP address.
Definition: ipsock.h:75
PwxString()
Definition: wxstring.h:43
This class describes a Universal Resource Locator.
Definition: url.h:54
bool operator==(const char *other) const
Definition: wxstring.h:62