| 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 CORE_FXCRT_INCLUDE_FX_STRING_H_ | 7 #ifndef CORE_FXCRT_INCLUDE_FX_STRING_H_ |
| 8 #define CORE_FXCRT_INCLUDE_FX_STRING_H_ | 8 #define CORE_FXCRT_INCLUDE_FX_STRING_H_ |
| 9 | 9 |
| 10 #include <stdint.h> // For intptr_t. | 10 #include <stdint.h> // For intptr_t. |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 bool operator==(const char* ptr) const; | 81 bool operator==(const char* ptr) const; |
| 82 bool operator==(const CFX_ByteStringC& str) const; | 82 bool operator==(const CFX_ByteStringC& str) const; |
| 83 bool operator==(const CFX_ByteString& other) const; | 83 bool operator==(const CFX_ByteString& other) const; |
| 84 | 84 |
| 85 bool operator!=(const char* ptr) const { return !(*this == ptr); } | 85 bool operator!=(const char* ptr) const { return !(*this == ptr); } |
| 86 bool operator!=(const CFX_ByteStringC& str) const { return !(*this == str); } | 86 bool operator!=(const CFX_ByteStringC& str) const { return !(*this == str); } |
| 87 bool operator!=(const CFX_ByteString& other) const { | 87 bool operator!=(const CFX_ByteString& other) const { |
| 88 return !(*this == other); | 88 return !(*this == other); |
| 89 } | 89 } |
| 90 | 90 |
| 91 bool operator<(const CFX_ByteString& str) const { | 91 bool operator<(const CFX_ByteString& str) const; |
| 92 int result = FXSYS_memcmp(c_str(), str.c_str(), | |
| 93 std::min(GetLength(), str.GetLength())); | |
| 94 return result < 0 || (result == 0 && GetLength() < str.GetLength()); | |
| 95 } | |
| 96 | 92 |
| 97 const CFX_ByteString& operator=(const FX_CHAR* str); | 93 const CFX_ByteString& operator=(const FX_CHAR* str); |
| 98 const CFX_ByteString& operator=(const CFX_ByteStringC& bstrc); | 94 const CFX_ByteString& operator=(const CFX_ByteStringC& bstrc); |
| 99 const CFX_ByteString& operator=(const CFX_ByteString& stringSrc); | 95 const CFX_ByteString& operator=(const CFX_ByteString& stringSrc); |
| 100 | 96 |
| 101 const CFX_ByteString& operator+=(FX_CHAR ch); | 97 const CFX_ByteString& operator+=(FX_CHAR ch); |
| 102 const CFX_ByteString& operator+=(const FX_CHAR* str); | 98 const CFX_ByteString& operator+=(const FX_CHAR* str); |
| 103 const CFX_ByteString& operator+=(const CFX_ByteString& str); | 99 const CFX_ByteString& operator+=(const CFX_ByteString& str); |
| 104 const CFX_ByteString& operator+=(const CFX_ByteStringC& bstrc); | 100 const CFX_ByteString& operator+=(const CFX_ByteStringC& bstrc); |
| 105 | 101 |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 bool operator==(const wchar_t* ptr) const; | 284 bool operator==(const wchar_t* ptr) const; |
| 289 bool operator==(const CFX_WideStringC& str) const; | 285 bool operator==(const CFX_WideStringC& str) const; |
| 290 bool operator==(const CFX_WideString& other) const; | 286 bool operator==(const CFX_WideString& other) const; |
| 291 | 287 |
| 292 bool operator!=(const wchar_t* ptr) const { return !(*this == ptr); } | 288 bool operator!=(const wchar_t* ptr) const { return !(*this == ptr); } |
| 293 bool operator!=(const CFX_WideStringC& str) const { return !(*this == str); } | 289 bool operator!=(const CFX_WideStringC& str) const { return !(*this == str); } |
| 294 bool operator!=(const CFX_WideString& other) const { | 290 bool operator!=(const CFX_WideString& other) const { |
| 295 return !(*this == other); | 291 return !(*this == other); |
| 296 } | 292 } |
| 297 | 293 |
| 298 bool operator<(const CFX_WideString& str) const { | 294 bool operator<(const CFX_WideString& str) const; |
| 299 int result = | |
| 300 wmemcmp(c_str(), str.c_str(), std::min(GetLength(), str.GetLength())); | |
| 301 return result < 0 || (result == 0 && GetLength() < str.GetLength()); | |
| 302 } | |
| 303 | 295 |
| 304 FX_WCHAR GetAt(FX_STRSIZE nIndex) const { | 296 FX_WCHAR GetAt(FX_STRSIZE nIndex) const { |
| 305 return m_pData ? m_pData->m_String[nIndex] : 0; | 297 return m_pData ? m_pData->m_String[nIndex] : 0; |
| 306 } | 298 } |
| 307 | 299 |
| 308 FX_WCHAR operator[](FX_STRSIZE nIndex) const { | 300 FX_WCHAR operator[](FX_STRSIZE nIndex) const { |
| 309 return m_pData ? m_pData->m_String[nIndex] : 0; | 301 return m_pData ? m_pData->m_String[nIndex] : 0; |
| 310 } | 302 } |
| 311 | 303 |
| 312 void SetAt(FX_STRSIZE nIndex, FX_WCHAR ch); | 304 void SetAt(FX_STRSIZE nIndex, FX_WCHAR ch); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 } | 426 } |
| 435 | 427 |
| 436 FX_FLOAT FX_atof(const CFX_ByteStringC& str); | 428 FX_FLOAT FX_atof(const CFX_ByteStringC& str); |
| 437 inline FX_FLOAT FX_atof(const CFX_WideStringC& wsStr) { | 429 inline FX_FLOAT FX_atof(const CFX_WideStringC& wsStr) { |
| 438 return FX_atof(FX_UTF8Encode(wsStr.c_str(), wsStr.GetLength()).c_str()); | 430 return FX_atof(FX_UTF8Encode(wsStr.c_str(), wsStr.GetLength()).c_str()); |
| 439 } | 431 } |
| 440 bool FX_atonum(const CFX_ByteStringC& str, void* pData); | 432 bool FX_atonum(const CFX_ByteStringC& str, void* pData); |
| 441 FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_CHAR* buf); | 433 FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_CHAR* buf); |
| 442 | 434 |
| 443 #endif // CORE_FXCRT_INCLUDE_FX_STRING_H_ | 435 #endif // CORE_FXCRT_INCLUDE_FX_STRING_H_ |
| OLD | NEW |