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

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

Issue 1977093002: Make CFX_ByteString(const CFX_ByteStringC&) explicit. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase, nit Created 4 years, 7 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/include/fx_basic.h ('k') | core/fxcrt/include/fx_xml.h » ('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 28 matching lines...) Expand all
39 CFX_ByteString(CFX_ByteString&& other) { m_pData.Swap(other.m_pData); } 39 CFX_ByteString(CFX_ByteString&& other) { m_pData.Swap(other.m_pData); }
40 40
41 // Deliberately implicit to avoid calling on every string literal. 41 // Deliberately implicit to avoid calling on every string literal.
42 CFX_ByteString(char ch); 42 CFX_ByteString(char ch);
43 CFX_ByteString(const FX_CHAR* ptr) 43 CFX_ByteString(const FX_CHAR* ptr)
44 : CFX_ByteString(ptr, ptr ? FXSYS_strlen(ptr) : 0) {} 44 : CFX_ByteString(ptr, ptr ? FXSYS_strlen(ptr) : 0) {}
45 45
46 CFX_ByteString(const FX_CHAR* ptr, FX_STRSIZE len); 46 CFX_ByteString(const FX_CHAR* ptr, FX_STRSIZE len);
47 CFX_ByteString(const uint8_t* ptr, FX_STRSIZE len); 47 CFX_ByteString(const uint8_t* ptr, FX_STRSIZE len);
48 48
49 // TODO(tsepez): mark constructor as explicit. 49 explicit CFX_ByteString(const CFX_ByteStringC& bstrc);
50 CFX_ByteString(const CFX_ByteStringC& bstrc);
51 CFX_ByteString(const CFX_ByteStringC& bstrc1, const CFX_ByteStringC& bstrc2); 50 CFX_ByteString(const CFX_ByteStringC& bstrc1, const CFX_ByteStringC& bstrc2);
52 51
53 ~CFX_ByteString(); 52 ~CFX_ByteString();
54 53
55 void clear() { m_pData.Reset(); } 54 void clear() { m_pData.Reset(); }
56 55
57 static CFX_ByteString FromUnicode(const FX_WCHAR* ptr, FX_STRSIZE len = -1); 56 static CFX_ByteString FromUnicode(const FX_WCHAR* ptr, FX_STRSIZE len = -1);
58 static CFX_ByteString FromUnicode(const CFX_WideString& str); 57 static CFX_ByteString FromUnicode(const CFX_WideString& str);
59 58
60 // Explicit conversion to C-style string. 59 // Explicit conversion to C-style string.
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 } 436 }
438 437
439 FX_FLOAT FX_atof(const CFX_ByteStringC& str); 438 FX_FLOAT FX_atof(const CFX_ByteStringC& str);
440 inline FX_FLOAT FX_atof(const CFX_WideStringC& wsStr) { 439 inline FX_FLOAT FX_atof(const CFX_WideStringC& wsStr) {
441 return FX_atof(FX_UTF8Encode(wsStr.c_str(), wsStr.GetLength()).c_str()); 440 return FX_atof(FX_UTF8Encode(wsStr.c_str(), wsStr.GetLength()).c_str());
442 } 441 }
443 void FX_atonum(const CFX_ByteStringC& str, FX_BOOL& bInteger, void* pData); 442 void FX_atonum(const CFX_ByteStringC& str, FX_BOOL& bInteger, void* pData);
444 FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_CHAR* buf); 443 FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_CHAR* buf);
445 444
446 #endif // CORE_FXCRT_INCLUDE_FX_STRING_H_ 445 #endif // CORE_FXCRT_INCLUDE_FX_STRING_H_
OLDNEW
« no previous file with comments | « core/fxcrt/include/fx_basic.h ('k') | core/fxcrt/include/fx_xml.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698