From 765c2083ff5482f43d13f5ca4df6dc7e541e09a7 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 1 Sep 2013 16:10:02 +0000 Subject: [PATCH] [FRAMEDYN] Remove operator LPWSTR() in favor of operator LPCWSTR() const (likely to fix its export ;-)) Add missing operators implementations as inline svn path=/trunk/; revision=59947 --- reactos/dll/win32/framedyn/chstring.cpp | 2 +- reactos/include/psdk/chstring.h | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/framedyn/chstring.cpp b/reactos/dll/win32/framedyn/chstring.cpp index f9b26c49360..88a988abbb1 100644 --- a/reactos/dll/win32/framedyn/chstring.cpp +++ b/reactos/dll/win32/framedyn/chstring.cpp @@ -1328,7 +1328,7 @@ WCHAR CHString::operator[](int nIndex) const /* * @implemented */ -CHString::operator LPWSTR() +CHString::operator LPCWSTR() const { return m_pchData; } diff --git a/reactos/include/psdk/chstring.h b/reactos/include/psdk/chstring.h index 81adecb4e99..166a6dc9685 100644 --- a/reactos/include/psdk/chstring.h +++ b/reactos/include/psdk/chstring.h @@ -84,7 +84,7 @@ public: WCHAR operator[](int nIndex) const; - operator LPWSTR(); + operator LPCWSTR() const; friend CHString WINAPI operator+(WCHAR ch, const CHString& string) throw (CHeap_Exception); friend CHString WINAPI operator+(const CHString& string, WCHAR ch) throw (CHeap_Exception); @@ -109,4 +109,22 @@ protected: static int WINAPI SafeStrlen(LPCWSTR lpsz); }; +inline BOOL operator==(const CHString& s1, LPCWSTR s2) { return s1.Compare(s2) == 0; } +inline BOOL operator==(const CHString& s1, const CHString& s2) { return s1.Compare(s2) == 0; } + +inline BOOL operator!=(const CHString& s1, LPCWSTR s2) { return s1.Compare(s2) != 0; } +inline BOOL operator!=(const CHString& s1, const CHString& s2) { return s1.Compare(s2) != 0; } + +inline BOOL operator<(const CHString& s1, LPCWSTR s2) { return s1.Compare(s2) < 0; } +inline BOOL operator<(const CHString& s1, const CHString& s2) { return s1.Compare(s2) < 0; } + +inline BOOL operator>(const CHString& s1, LPCWSTR s2) { return s1.Compare(s2) > 0; } +inline BOOL operator>(const CHString& s1, const CHString& s2) { return s1.Compare(s2) > 0; } + +inline BOOL operator<=(const CHString& s1, LPCWSTR s2) { return s1.Compare(s2) <= 0; } +inline BOOL operator<=(const CHString& s1, const CHString& s2) { return s1.Compare(s2) <= 0; } + +inline BOOL operator>=(const CHString& s1, LPCWSTR s2) { return s1.Compare(s2) >= 0; } +inline BOOL operator>=(const CHString& s1, const CHString& s2) { return s1.Compare(s2) >= 0; } + #endif