Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: core/fxcrt/include/fx_string.h

Issue 1882043004: Remove implicit cast from CFX_WideString to (const wchar_t*) (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: win error #2 Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fxcrt/fx_arabic.cpp ('k') | fpdfsdk/fsdk_baseform.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 490
491 static CFX_WideString FromUTF8(const CFX_ByteStringC& str); 491 static CFX_WideString FromUTF8(const CFX_ByteStringC& str);
492 static CFX_WideString FromUTF16LE(const unsigned short* str, FX_STRSIZE len); 492 static CFX_WideString FromUTF16LE(const unsigned short* str, FX_STRSIZE len);
493 493
494 static FX_STRSIZE WStringLength(const unsigned short* str); 494 static FX_STRSIZE WStringLength(const unsigned short* str);
495 495
496 // Explicit conversion to C-style wide string. 496 // Explicit conversion to C-style wide string.
497 // Note: Any subsequent modification of |this| will invalidate the result. 497 // Note: Any subsequent modification of |this| will invalidate the result.
498 const FX_WCHAR* c_str() const { return m_pData ? m_pData->m_String : L""; } 498 const FX_WCHAR* c_str() const { return m_pData ? m_pData->m_String : L""; }
499 499
500 // Implicit conversion to C-style wide string -- deprecated.
501 // Note: Any subsequent modification of |this| will invalidate the result.
502 operator const FX_WCHAR*() const { return m_pData ? m_pData->m_String : L""; }
503
504 // Explicit conversion to CFX_WideStringC. 500 // Explicit conversion to CFX_WideStringC.
505 // Note: Any subsequent modification of |this| will invalidate the result. 501 // Note: Any subsequent modification of |this| will invalidate the result.
506 CFX_WideStringC AsStringC() const { 502 CFX_WideStringC AsStringC() const {
507 return CFX_WideStringC(c_str(), GetLength()); 503 return CFX_WideStringC(c_str(), GetLength());
508 } 504 }
509 505
510 // Deprecated -- use clear(). 506 // Deprecated -- use clear().
511 void Empty() { m_pData.Reset(); } 507 void Empty() { m_pData.Reset(); }
512 void clear() { m_pData.Reset(); } 508 void clear() { m_pData.Reset(); }
513 509
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 } 674 }
679 675
680 FX_FLOAT FX_atof(const CFX_ByteStringC& str); 676 FX_FLOAT FX_atof(const CFX_ByteStringC& str);
681 inline FX_FLOAT FX_atof(const CFX_WideStringC& wsStr) { 677 inline FX_FLOAT FX_atof(const CFX_WideStringC& wsStr) {
682 return FX_atof(FX_UTF8Encode(wsStr.c_str(), wsStr.GetLength()).c_str()); 678 return FX_atof(FX_UTF8Encode(wsStr.c_str(), wsStr.GetLength()).c_str());
683 } 679 }
684 void FX_atonum(const CFX_ByteStringC& str, FX_BOOL& bInteger, void* pData); 680 void FX_atonum(const CFX_ByteStringC& str, FX_BOOL& bInteger, void* pData);
685 FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_CHAR* buf); 681 FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_CHAR* buf);
686 682
687 #endif // CORE_FXCRT_INCLUDE_FX_STRING_H_ 683 #endif // CORE_FXCRT_INCLUDE_FX_STRING_H_
OLDNEW
« no previous file with comments | « core/fxcrt/fx_arabic.cpp ('k') | fpdfsdk/fsdk_baseform.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698