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

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

Issue 1977093002: Make CFX_ByteString(const CFX_ByteStringC&) explicit. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: First mac-only fix 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
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_BASIC_H_ 7 #ifndef CORE_FXCRT_INCLUDE_FX_BASIC_H_
8 #define CORE_FXCRT_INCLUDE_FX_BASIC_H_ 8 #define CORE_FXCRT_INCLUDE_FX_BASIC_H_
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 void ExpandBuf(FX_STRSIZE size); 49 void ExpandBuf(FX_STRSIZE size);
50 50
51 FX_STRSIZE m_AllocStep; 51 FX_STRSIZE m_AllocStep;
52 FX_STRSIZE m_AllocSize; 52 FX_STRSIZE m_AllocSize;
53 FX_STRSIZE m_DataSize; 53 FX_STRSIZE m_DataSize;
54 std::unique_ptr<uint8_t, FxFreeDeleter> m_pBuffer; 54 std::unique_ptr<uint8_t, FxFreeDeleter> m_pBuffer;
55 }; 55 };
56 56
57 class CFX_ByteTextBuf : public CFX_BinaryBuf { 57 class CFX_ByteTextBuf : public CFX_BinaryBuf {
58 public: 58 public:
59 void AppendChar(int ch) { AppendByte((uint8_t)ch); }
60 FX_STRSIZE GetLength() const { return m_DataSize; } 59 FX_STRSIZE GetLength() const { return m_DataSize; }
61 CFX_ByteStringC AsStringC() const; 60 CFX_ByteString MakeString() const {
61 return CFX_ByteString(m_pBuffer.get(), m_DataSize);
62 }
63 CFX_ByteStringC AsStringC() const {
64 return CFX_ByteStringC(m_pBuffer.get(), m_DataSize);
65 }
62 66
67 void AppendChar(int ch) { AppendByte(static_cast<uint8_t>(ch)); }
63 CFX_ByteTextBuf& operator<<(int i); 68 CFX_ByteTextBuf& operator<<(int i);
64 CFX_ByteTextBuf& operator<<(uint32_t i); 69 CFX_ByteTextBuf& operator<<(uint32_t i);
65 CFX_ByteTextBuf& operator<<(double f); 70 CFX_ByteTextBuf& operator<<(double f);
66 CFX_ByteTextBuf& operator<<(const FX_CHAR* pStr) { 71 CFX_ByteTextBuf& operator<<(const FX_CHAR* pStr) {
67 return *this << CFX_ByteStringC(pStr); 72 return *this << CFX_ByteStringC(pStr);
68 } 73 }
69 CFX_ByteTextBuf& operator<<(const CFX_ByteString& str) { 74 CFX_ByteTextBuf& operator<<(const CFX_ByteString& str) {
70 return *this << str.AsStringC(); 75 return *this << str.AsStringC();
71 } 76 }
72 CFX_ByteTextBuf& operator<<(const CFX_ByteStringC& lpsz); 77 CFX_ByteTextBuf& operator<<(const CFX_ByteStringC& lpsz);
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 FX_FLOAT c; 1054 FX_FLOAT c;
1050 FX_FLOAT d; 1055 FX_FLOAT d;
1051 FX_FLOAT e; 1056 FX_FLOAT e;
1052 FX_FLOAT f; 1057 FX_FLOAT f;
1053 FX_FLOAT g; 1058 FX_FLOAT g;
1054 FX_FLOAT h; 1059 FX_FLOAT h;
1055 FX_FLOAT i; 1060 FX_FLOAT i;
1056 }; 1061 };
1057 1062
1058 #endif // CORE_FXCRT_INCLUDE_FX_BASIC_H_ 1063 #endif // CORE_FXCRT_INCLUDE_FX_BASIC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698