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> | 10 #include <algorithm> |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 const CFX_WideString& operator =(const CFX_WideStringC& stringSrc); | 647 const CFX_WideString& operator =(const CFX_WideStringC& stringSrc); |
648 | 648 |
649 const CFX_WideString& operator += (FX_LPCWSTR str); | 649 const CFX_WideString& operator += (FX_LPCWSTR str); |
650 | 650 |
651 const CFX_WideString& operator += (FX_WCHAR ch); | 651 const CFX_WideString& operator += (FX_WCHAR ch); |
652 | 652 |
653 const CFX_WideString& operator += (const CFX_WideString& str); | 653 const CFX_WideString& operator += (const CFX_WideString& str); |
654 | 654 |
655 const CFX_WideString& operator += (const CFX_WideStringC& str); | 655 const CFX_WideString& operator += (const CFX_WideStringC& str); |
656 | 656 |
| 657 bool operator< (const CFX_WideString& str) const { |
| 658 int result = wmemcmp(c_str(), str.c_str(), std::min(GetLength(), str.Get
Length())); |
| 659 return result < 0 || (result == 0 && GetLength() < str.GetLength()); |
| 660 } |
| 661 |
657 FX_WCHAR GetAt(FX_STRSIZE nIndex) const | 662 FX_WCHAR GetAt(FX_STRSIZE nIndex) const |
658 { | 663 { |
659 return m_pData ? m_pData->m_String[nIndex] : 0; | 664 return m_pData ? m_pData->m_String[nIndex] : 0; |
660 } | 665 } |
661 | 666 |
662 FX_WCHAR operator[](FX_STRSIZE nIndex) const | 667 FX_WCHAR operator[](FX_STRSIZE nIndex) const |
663 { | 668 { |
664 return m_pData ? m_pData->m_String[nIndex] : 0; | 669 return m_pData ? m_pData->m_String[nIndex] : 0; |
665 } | 670 } |
666 | 671 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 CFX_ByteString FX_UTF8Encode(FX_LPCWSTR pwsStr, FX_STRSIZE len); | 824 CFX_ByteString FX_UTF8Encode(FX_LPCWSTR pwsStr, FX_STRSIZE len); |
820 inline CFX_ByteString FX_UTF8Encode(FX_WSTR wsStr) | 825 inline CFX_ByteString FX_UTF8Encode(FX_WSTR wsStr) |
821 { | 826 { |
822 return FX_UTF8Encode(wsStr.GetPtr(), wsStr.GetLength()); | 827 return FX_UTF8Encode(wsStr.GetPtr(), wsStr.GetLength()); |
823 } | 828 } |
824 inline CFX_ByteString FX_UTF8Encode(const CFX_WideString &wsStr) | 829 inline CFX_ByteString FX_UTF8Encode(const CFX_WideString &wsStr) |
825 { | 830 { |
826 return FX_UTF8Encode(wsStr.c_str(), wsStr.GetLength()); | 831 return FX_UTF8Encode(wsStr.c_str(), wsStr.GetLength()); |
827 } | 832 } |
828 #endif | 833 #endif |
OLD | NEW |