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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 static CFX_WideString FromCodePage(const CFX_ByteStringC& str, | 489 static CFX_WideString FromCodePage(const CFX_ByteStringC& str, |
490 uint16_t codepage); | 490 uint16_t codepage); |
491 | 491 |
492 static CFX_WideString FromUTF8(const CFX_ByteStringC& str); | 492 static CFX_WideString FromUTF8(const CFX_ByteStringC& str); |
493 static CFX_WideString FromUTF16LE(const unsigned short* str, FX_STRSIZE len); | 493 static CFX_WideString FromUTF16LE(const unsigned short* str, FX_STRSIZE len); |
494 | 494 |
495 static FX_STRSIZE WStringLength(const unsigned short* str); | 495 static FX_STRSIZE WStringLength(const unsigned short* str); |
496 | 496 |
497 // Explicit conversion to C-style wide string. | 497 // Explicit conversion to C-style wide string. |
498 // Note: Any subsequent modification of |this| will invalidate the result. | 498 // Note: Any subsequent modification of |this| will invalidate the result. |
499 const FX_WCHAR* c_str() const { return m_pData ? m_pData->m_String : L""; } | 499 const FX_WCHAR* c_str() const; |
500 | 500 |
501 // Explicit conversion to CFX_WideStringC. | 501 // Explicit conversion to CFX_WideStringC. |
502 // Note: Any subsequent modification of |this| will invalidate the result. | 502 // Note: Any subsequent modification of |this| will invalidate the result. |
503 CFX_WideStringC AsStringC() const { | 503 CFX_WideStringC AsStringC() const { |
504 return CFX_WideStringC(c_str(), GetLength()); | 504 return CFX_WideStringC(c_str(), GetLength()); |
505 } | 505 } |
506 | 506 |
507 void clear() { m_pData.Reset(); } | 507 void clear() { m_pData.Reset(); } |
508 | 508 |
509 FX_STRSIZE GetLength() const { return m_pData ? m_pData->m_nDataLength : 0; } | 509 FX_STRSIZE GetLength() const { return m_pData ? m_pData->m_nDataLength : 0; } |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 } | 667 } |
668 | 668 |
669 FX_FLOAT FX_atof(const CFX_ByteStringC& str); | 669 FX_FLOAT FX_atof(const CFX_ByteStringC& str); |
670 inline FX_FLOAT FX_atof(const CFX_WideStringC& wsStr) { | 670 inline FX_FLOAT FX_atof(const CFX_WideStringC& wsStr) { |
671 return FX_atof(FX_UTF8Encode(wsStr.c_str(), wsStr.GetLength()).c_str()); | 671 return FX_atof(FX_UTF8Encode(wsStr.c_str(), wsStr.GetLength()).c_str()); |
672 } | 672 } |
673 void FX_atonum(const CFX_ByteStringC& str, FX_BOOL& bInteger, void* pData); | 673 void FX_atonum(const CFX_ByteStringC& str, FX_BOOL& bInteger, void* pData); |
674 FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_CHAR* buf); | 674 FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_CHAR* buf); |
675 | 675 |
676 #endif // CORE_FXCRT_INCLUDE_FX_STRING_H_ | 676 #endif // CORE_FXCRT_INCLUDE_FX_STRING_H_ |
OLD | NEW |