diff options
Diffstat (limited to 'WebKit/chromium/public/WebCString.h')
-rw-r--r-- | WebKit/chromium/public/WebCString.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/WebKit/chromium/public/WebCString.h b/WebKit/chromium/public/WebCString.h index 434cb06..0320eb6 100644 --- a/WebKit/chromium/public/WebCString.h +++ b/WebKit/chromium/public/WebCString.h @@ -34,11 +34,15 @@ #include "WebCommon.h" #if WEBKIT_IMPLEMENTATION -namespace WebCore { class CString; } +#include <wtf/Forward.h> #else #include <string> #endif +namespace WTF { +class CString; +} + namespace WebKit { class WebCStringPrivate; @@ -68,6 +72,11 @@ public: return *this; } + // Returns 0 if both strings are equals, a value greater than zero if the + // first character that does not match has a greater value in this string + // than in |other|, or a value less than zero to indicate the opposite. + WEBKIT_API int compare(const WebCString& other) const; + WEBKIT_API void reset(); WEBKIT_API void assign(const WebCString&); WEBKIT_API void assign(const char* data, size_t len); @@ -84,9 +93,9 @@ public: WEBKIT_API static WebCString fromUTF16(const WebUChar* data); #if WEBKIT_IMPLEMENTATION - WebCString(const WebCore::CString&); - WebCString& operator=(const WebCore::CString&); - operator WebCore::CString() const; + WebCString(const WTF::CString&); + WebCString& operator=(const WTF::CString&); + operator WTF::CString() const; #else WebCString(const std::string& s) : m_private(0) { @@ -117,6 +126,11 @@ private: WebCStringPrivate* m_private; }; +inline bool operator<(const WebCString& a, const WebCString& b) +{ + return a.compare(b) < 0; +} + } // namespace WebKit #endif |