Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Unified Diff: core/include/fxcrt/fx_string.h

Issue 1099193002: Add missing operators for CFX_WideStringC. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | core/src/fxcrt/fx_basic_wstring_unittest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/include/fxcrt/fx_string.h
diff --git a/core/include/fxcrt/fx_string.h b/core/include/fxcrt/fx_string.h
index c1a6ec699e585cd2d422fe5a746e44761690b625..1efb814b087ef5c8dcfe2d356c15bcfa87e14574 100644
--- a/core/include/fxcrt/fx_string.h
+++ b/core/include/fxcrt/fx_string.h
@@ -441,7 +441,7 @@ inline CFX_ByteString operator + (FX_BSTR str1, const CFX_ByteString& str2)
{
return CFX_ByteString(str1, str2);
}
-class CFX_WideStringC
+class CFX_WideStringC
{
public:
typedef FX_WCHAR value_type;
@@ -563,13 +563,23 @@ public:
}
return CFX_WideStringC(m_Ptr + m_Length - count, count);
}
-protected:
- FX_LPCWSTR m_Ptr;
+ const FX_WCHAR& operator[] (size_t index) const
+ {
+ return m_Ptr[index];
+ }
+
+ bool operator< (const CFX_WideStringC& that) const
+ {
+ int result = wmemcmp(m_Ptr, that.m_Ptr, std::min(m_Length, that.m_Length));
+ return result < 0 || (result == 0 && m_Length < that.m_Length);
+ }
+protected:
+ FX_LPCWSTR m_Ptr;
FX_STRSIZE m_Length;
-private:
+private:
void* operator new (size_t) throw()
{
return NULL;
« no previous file with comments | « no previous file | core/src/fxcrt/fx_basic_wstring_unittest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698