]> git.saurik.com Git - wxWidgets.git/commitdiff
operator for wxString == wx[W]CharBuffer.
authorOve Kaaven <ovek@arcticnet.no>
Mon, 14 Jun 1999 14:23:18 +0000 (14:23 +0000)
committerOve Kaaven <ovek@arcticnet.no>
Mon, 14 Jun 1999 14:23:18 +0000 (14:23 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2780 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/string.h

index ec5cc0991006c329ed49893e0b19e51268a8f9f6..91d990fdbdf5032cf5e1090152fd2bc2411022f8 100644 (file)
@@ -1037,6 +1037,18 @@ inline bool operator>=(const wxString& s1, const wxChar  * s2) { return (s1.Cmp(
 //
 inline bool operator>=(const wxChar  * s1, const wxString& s2) { return (s2.Cmp(s1) <= 0); }
 
+#if wxUSE_UNICODE
+inline bool operator==(const wxString& s1, const wxWCharBuffer& s2)
+{ return (s1.Cmp((const wchar_t *)s2) == 0); }
+inline bool operator==(const wxWCharBuffer& s1, const wxString& s2)
+{ return (s2.Cmp((const wchar_t *)s1) == 0); }
+#else
+inline bool operator==(const wxString& s1, const wxCharBuffer& s2)
+{ return (s1.Cmp((const char *)s2) == 0); }
+inline bool operator==(const wxCharBuffer& s1, const wxString& s2)
+{ return (s2.Cmp((const char *)s1) == 0); }
+#endif
+
 wxString WXDLLEXPORT operator+(const wxString& string1,  const wxString& string2);
 wxString WXDLLEXPORT operator+(const wxString& string, wxChar ch);
 wxString WXDLLEXPORT operator+(wxChar ch, const wxString& string);