Chromium Code Reviews| Index: core/include/fxcrt/fx_string.h |
| diff --git a/core/include/fxcrt/fx_string.h b/core/include/fxcrt/fx_string.h |
| index df7dd0c76241e359af3e367c400d759a9da9c463..66df6c2cc145167d6ed45b21baac9ba72ddec64f 100644 |
| --- a/core/include/fxcrt/fx_string.h |
| +++ b/core/include/fxcrt/fx_string.h |
| @@ -7,6 +7,8 @@ |
| #ifndef _FX_STRING_H_ |
| #define _FX_STRING_H_ |
| +#include <algorithm> |
| + |
| #include "fx_memory.h" |
| class CFX_ByteStringC; |
| @@ -484,7 +486,7 @@ public: |
| FX_CHAR m_Buffer[limit]; |
| }; |
| typedef CFX_StringBufTemplate<256> CFX_StringBuf256; |
| -class CFX_WideStringC |
| +class CFX_WideStringC |
| { |
| public: |
| typedef FX_WCHAR value_type; |
| @@ -606,13 +608,23 @@ public: |
| } |
| return CFX_WideStringC(m_Ptr + m_Length - count, count); |
| } |
| -protected: |
| - FX_LPCWSTR m_Ptr; |
| + const FX_WCHAR& operator[] (int index) const |
|
Lei Zhang
2015/04/21 22:07:56
Same as last CL, size_t ?
Tom Sepez
2015/04/22 17:06:45
Done.
|
| + { |
| + return m_Ptr[index]; |
| + } |
| + bool operator< (const CFX_WideStringC& that) |
|
brucedawson
2015/04/22 10:47:12
The operator itself needs to be const.
Tom Sepez
2015/04/22 17:06:45
Done.
|
| + { |
| + int result = wmemcmp(m_Ptr, that.m_Ptr, std::min(m_Length, that.m_Length)); |
|
Tom Sepez
2015/04/22 17:06:45
Bruce, you're OK with wmemcmp, right? No windows
|
| + 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; |