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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 CFX_WideString(const CFX_WideString& other) : m_pData(other.m_pData) {} | 243 CFX_WideString(const CFX_WideString& other) : m_pData(other.m_pData) {} |
244 CFX_WideString(CFX_WideString&& other) { m_pData.Swap(other.m_pData); } | 244 CFX_WideString(CFX_WideString&& other) { m_pData.Swap(other.m_pData); } |
245 | 245 |
246 // Deliberately implicit to avoid calling on every string literal. | 246 // Deliberately implicit to avoid calling on every string literal. |
247 CFX_WideString(FX_WCHAR ch); | 247 CFX_WideString(FX_WCHAR ch); |
248 CFX_WideString(const FX_WCHAR* ptr) | 248 CFX_WideString(const FX_WCHAR* ptr) |
249 : CFX_WideString(ptr, ptr ? FXSYS_wcslen(ptr) : 0) {} | 249 : CFX_WideString(ptr, ptr ? FXSYS_wcslen(ptr) : 0) {} |
250 | 250 |
251 CFX_WideString(const FX_WCHAR* ptr, FX_STRSIZE len); | 251 CFX_WideString(const FX_WCHAR* ptr, FX_STRSIZE len); |
252 | 252 |
253 // TODO(tsepez): mark constructor as explicit. | 253 explicit CFX_WideString(const CFX_WideStringC& str); |
254 CFX_WideString(const CFX_WideStringC& str); | |
255 CFX_WideString(const CFX_WideStringC& str1, const CFX_WideStringC& str2); | 254 CFX_WideString(const CFX_WideStringC& str1, const CFX_WideStringC& str2); |
256 | 255 |
257 ~CFX_WideString(); | 256 ~CFX_WideString(); |
258 | 257 |
259 static CFX_WideString FromLocal(const CFX_ByteStringC& str); | 258 static CFX_WideString FromLocal(const CFX_ByteStringC& str); |
260 static CFX_WideString FromCodePage(const CFX_ByteStringC& str, | 259 static CFX_WideString FromCodePage(const CFX_ByteStringC& str, |
261 uint16_t codepage); | 260 uint16_t codepage); |
262 | 261 |
263 static CFX_WideString FromUTF8(const CFX_ByteStringC& str); | 262 static CFX_WideString FromUTF8(const CFX_ByteStringC& str); |
264 static CFX_WideString FromUTF16LE(const unsigned short* str, FX_STRSIZE len); | 263 static CFX_WideString FromUTF16LE(const unsigned short* str, FX_STRSIZE len); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 } | 437 } |
439 | 438 |
440 FX_FLOAT FX_atof(const CFX_ByteStringC& str); | 439 FX_FLOAT FX_atof(const CFX_ByteStringC& str); |
441 inline FX_FLOAT FX_atof(const CFX_WideStringC& wsStr) { | 440 inline FX_FLOAT FX_atof(const CFX_WideStringC& wsStr) { |
442 return FX_atof(FX_UTF8Encode(wsStr.c_str(), wsStr.GetLength()).c_str()); | 441 return FX_atof(FX_UTF8Encode(wsStr.c_str(), wsStr.GetLength()).c_str()); |
443 } | 442 } |
444 void FX_atonum(const CFX_ByteStringC& str, FX_BOOL& bInteger, void* pData); | 443 void FX_atonum(const CFX_ByteStringC& str, FX_BOOL& bInteger, void* pData); |
445 FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_CHAR* buf); | 444 FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_CHAR* buf); |
446 | 445 |
447 #endif // CORE_FXCRT_INCLUDE_FX_STRING_H_ | 446 #endif // CORE_FXCRT_INCLUDE_FX_STRING_H_ |
OLD | NEW |