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

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

Issue 1885973002: Remove implicit cast from CFX_ByteString to (const char*). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Typo 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_basic_util.cpp ('k') | core/fxge/apple/fx_mac_imp.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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 void Empty() { m_pData.Reset(); } 163 void Empty() { m_pData.Reset(); }
164 void clear() { m_pData.Reset(); } 164 void clear() { m_pData.Reset(); }
165 165
166 static CFX_ByteString FromUnicode(const FX_WCHAR* ptr, FX_STRSIZE len = -1); 166 static CFX_ByteString FromUnicode(const FX_WCHAR* ptr, FX_STRSIZE len = -1);
167 static CFX_ByteString FromUnicode(const CFX_WideString& str); 167 static CFX_ByteString FromUnicode(const CFX_WideString& str);
168 168
169 // Explicit conversion to C-style string. 169 // Explicit conversion to C-style string.
170 // Note: Any subsequent modification of |this| will invalidate the result. 170 // Note: Any subsequent modification of |this| will invalidate the result.
171 const FX_CHAR* c_str() const { return m_pData ? m_pData->m_String : ""; } 171 const FX_CHAR* c_str() const { return m_pData ? m_pData->m_String : ""; }
172 172
173 // Implicit conversion to C-style string -- deprecated.
174 operator const FX_CHAR*() const { return m_pData ? m_pData->m_String : ""; }
175
176 // Explicit conversion to uint8_t*. 173 // Explicit conversion to uint8_t*.
177 // Note: Any subsequent modification of |this| will invalidate the result. 174 // Note: Any subsequent modification of |this| will invalidate the result.
178 const uint8_t* raw_str() const { 175 const uint8_t* raw_str() const {
179 return m_pData ? reinterpret_cast<const uint8_t*>(m_pData->m_String) 176 return m_pData ? reinterpret_cast<const uint8_t*>(m_pData->m_String)
180 : nullptr; 177 : nullptr;
181 } 178 }
182 179
183 // Explicit conversion to CFX_ByteStringC. 180 // Explicit conversion to CFX_ByteStringC.
184 // Note: Any subsequent modification of |this| will invalidate the result. 181 // Note: Any subsequent modification of |this| will invalidate the result.
185 CFX_ByteStringC AsStringC() const { 182 CFX_ByteStringC AsStringC() const {
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 } 678 }
682 679
683 FX_FLOAT FX_atof(const CFX_ByteStringC& str); 680 FX_FLOAT FX_atof(const CFX_ByteStringC& str);
684 inline FX_FLOAT FX_atof(const CFX_WideStringC& wsStr) { 681 inline FX_FLOAT FX_atof(const CFX_WideStringC& wsStr) {
685 return FX_atof(FX_UTF8Encode(wsStr.c_str(), wsStr.GetLength()).c_str()); 682 return FX_atof(FX_UTF8Encode(wsStr.c_str(), wsStr.GetLength()).c_str());
686 } 683 }
687 void FX_atonum(const CFX_ByteStringC& str, FX_BOOL& bInteger, void* pData); 684 void FX_atonum(const CFX_ByteStringC& str, FX_BOOL& bInteger, void* pData);
688 FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_CHAR* buf); 685 FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_CHAR* buf);
689 686
690 #endif // CORE_FXCRT_INCLUDE_FX_STRING_H_ 687 #endif // CORE_FXCRT_INCLUDE_FX_STRING_H_
OLDNEW
« no previous file with comments | « core/fxcrt/fx_basic_util.cpp ('k') | core/fxge/apple/fx_mac_imp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698