OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef _FX_STRING_H_ | 7 #ifndef _FX_STRING_H_ |
8 #define _FX_STRING_H_ | 8 #define _FX_STRING_H_ |
9 | 9 |
| 10 #include <algorithm> |
| 11 |
10 #include "fx_memory.h" | 12 #include "fx_memory.h" |
11 | 13 |
12 class CFX_ByteStringC; | 14 class CFX_ByteStringC; |
13 class CFX_ByteString; | 15 class CFX_ByteString; |
14 class CFX_WideStringC; | 16 class CFX_WideStringC; |
15 class CFX_WideString; | 17 class CFX_WideString; |
16 struct CFX_CharMap; | 18 struct CFX_CharMap; |
17 class CFX_BinaryBuf; | 19 class CFX_BinaryBuf; |
18 typedef int FX_STRSIZE; | 20 typedef int FX_STRSIZE; |
19 class CFX_ByteStringL; | 21 class CFX_ByteStringL; |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 bool operator != (FX_BSTR str) const | 256 bool operator != (FX_BSTR str) const |
255 { | 257 { |
256 return !Equal(str); | 258 return !Equal(str); |
257 } | 259 } |
258 | 260 |
259 bool operator != (const CFX_ByteStrin
g& str) const | 261 bool operator != (const CFX_ByteStrin
g& str) const |
260 { | 262 { |
261 return !operator==(str); | 263 return !operator==(str); |
262 } | 264 } |
263 | 265 |
| 266 bool operator< (const CFX_ByteString& str) const |
| 267 { |
| 268 int result = FXSYS_memcmp32(c_str(), str.c_str(), std::min(GetLength(),
str.GetLength())); |
| 269 return result < 0 || (result == 0 && GetLength() < str.GetLength()); |
| 270 } |
| 271 |
264 void Empty(); | 272 void Empty(); |
265 | 273 |
266 const CFX_ByteString& operator = (FX_LPCSTR str); | 274 const CFX_ByteString& operator = (FX_LPCSTR str); |
267 | 275 |
268 const CFX_ByteString& operator = (FX_BSTR bstrc); | 276 const CFX_ByteString& operator = (FX_BSTR bstrc); |
269 | 277 |
270 const CFX_ByteString& operator = (const CFX_ByteString& stringSrc); | 278 const CFX_ByteString& operator = (const CFX_ByteString& stringSrc); |
271 | 279 |
272 const CFX_ByteString& operator = (const CFX_BinaryBuf& buf); | 280 const CFX_ByteString& operator = (const CFX_BinaryBuf& buf); |
273 | 281 |
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 CFX_ByteString FX_UTF8Encode(FX_LPCWSTR pwsStr, FX_STRSIZE len); | 875 CFX_ByteString FX_UTF8Encode(FX_LPCWSTR pwsStr, FX_STRSIZE len); |
868 inline CFX_ByteString FX_UTF8Encode(FX_WSTR wsStr) | 876 inline CFX_ByteString FX_UTF8Encode(FX_WSTR wsStr) |
869 { | 877 { |
870 return FX_UTF8Encode(wsStr.GetPtr(), wsStr.GetLength()); | 878 return FX_UTF8Encode(wsStr.GetPtr(), wsStr.GetLength()); |
871 } | 879 } |
872 inline CFX_ByteString FX_UTF8Encode(const CFX_WideString &wsStr) | 880 inline CFX_ByteString FX_UTF8Encode(const CFX_WideString &wsStr) |
873 { | 881 { |
874 return FX_UTF8Encode(wsStr.c_str(), wsStr.GetLength()); | 882 return FX_UTF8Encode(wsStr.c_str(), wsStr.GetLength()); |
875 } | 883 } |
876 #endif | 884 #endif |
OLD | NEW |