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

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

Issue 1886263003: Rename CFX_ByteTextBuf::GetByteString() to AsStringC(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: 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
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
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); } 59 void AppendChar(int ch) { AppendByte((uint8_t)ch); }
60 FX_STRSIZE GetLength() const { return m_DataSize; } 60 FX_STRSIZE GetLength() const { return m_DataSize; }
61 CFX_ByteStringC GetByteString() const; 61 CFX_ByteStringC AsStringC() const;
62 62
63 CFX_ByteTextBuf& operator<<(int i); 63 CFX_ByteTextBuf& operator<<(int i);
64 CFX_ByteTextBuf& operator<<(uint32_t i); 64 CFX_ByteTextBuf& operator<<(uint32_t i);
65 CFX_ByteTextBuf& operator<<(double f); 65 CFX_ByteTextBuf& operator<<(double f);
66 CFX_ByteTextBuf& operator<<(const FX_CHAR* pStr) { 66 CFX_ByteTextBuf& operator<<(const FX_CHAR* pStr) {
67 return *this << CFX_ByteStringC(pStr); 67 return *this << CFX_ByteStringC(pStr);
68 } 68 }
69 CFX_ByteTextBuf& operator<<(const CFX_ByteString& str) { 69 CFX_ByteTextBuf& operator<<(const CFX_ByteString& str) {
70 return *this << str.AsStringC(); 70 return *this << str.AsStringC();
71 } 71 }
72 CFX_ByteTextBuf& operator<<(const CFX_ByteStringC& lpsz); 72 CFX_ByteTextBuf& operator<<(const CFX_ByteStringC& lpsz);
73 CFX_ByteTextBuf& operator<<(const CFX_ByteTextBuf& buf); 73 CFX_ByteTextBuf& operator<<(const CFX_ByteTextBuf& buf);
74 }; 74 };
75 75
76 class CFX_WideTextBuf : public CFX_BinaryBuf { 76 class CFX_WideTextBuf : public CFX_BinaryBuf {
77 public: 77 public:
78 void AppendChar(FX_WCHAR wch); 78 void AppendChar(FX_WCHAR wch);
79 FX_STRSIZE GetLength() const { return m_DataSize / sizeof(FX_WCHAR); } 79 FX_STRSIZE GetLength() const { return m_DataSize / sizeof(FX_WCHAR); }
80 FX_WCHAR* GetBuffer() const { 80 FX_WCHAR* GetBuffer() const {
81 return reinterpret_cast<FX_WCHAR*>(m_pBuffer.get()); 81 return reinterpret_cast<FX_WCHAR*>(m_pBuffer.get());
82 } 82 }
83 CFX_WideStringC GetWideString() const; 83 CFX_WideStringC AsStringC() const;
84 84
85 void Delete(int start_index, int count) { 85 void Delete(int start_index, int count) {
86 CFX_BinaryBuf::Delete(start_index * sizeof(FX_WCHAR), 86 CFX_BinaryBuf::Delete(start_index * sizeof(FX_WCHAR),
87 count * sizeof(FX_WCHAR)); 87 count * sizeof(FX_WCHAR));
88 } 88 }
89 89
90 CFX_WideTextBuf& operator<<(int i); 90 CFX_WideTextBuf& operator<<(int i);
91 CFX_WideTextBuf& operator<<(double f); 91 CFX_WideTextBuf& operator<<(double f);
92 CFX_WideTextBuf& operator<<(const FX_WCHAR* lpsz); 92 CFX_WideTextBuf& operator<<(const FX_WCHAR* lpsz);
93 CFX_WideTextBuf& operator<<(const CFX_WideStringC& str); 93 CFX_WideTextBuf& operator<<(const CFX_WideStringC& str);
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 CFX_UTF8Decoder() { m_PendingBytes = 0; } 199 CFX_UTF8Decoder() { m_PendingBytes = 0; }
200 200
201 void Clear(); 201 void Clear();
202 202
203 void Input(uint8_t byte); 203 void Input(uint8_t byte);
204 204
205 void AppendChar(uint32_t ch); 205 void AppendChar(uint32_t ch);
206 206
207 void ClearStatus() { m_PendingBytes = 0; } 207 void ClearStatus() { m_PendingBytes = 0; }
208 208
209 CFX_WideStringC GetResult() const { return m_Buffer.GetWideString(); } 209 CFX_WideStringC GetResult() const { return m_Buffer.AsStringC(); }
210 210
211 protected: 211 protected:
212 int m_PendingBytes; 212 int m_PendingBytes;
213 213
214 uint32_t m_PendingChar; 214 uint32_t m_PendingChar;
215 215
216 CFX_WideTextBuf m_Buffer; 216 CFX_WideTextBuf m_Buffer;
217 }; 217 };
218 218
219 class CFX_UTF8Encoder { 219 class CFX_UTF8Encoder {
220 public: 220 public:
221 CFX_UTF8Encoder() {} 221 CFX_UTF8Encoder() {}
222 222
223 void Input(FX_WCHAR unicode); 223 void Input(FX_WCHAR unicode);
224 void AppendStr(const CFX_ByteStringC& str) { m_Buffer << str; } 224 void AppendStr(const CFX_ByteStringC& str) { m_Buffer << str; }
225 CFX_ByteStringC GetResult() const { return m_Buffer.GetByteString(); } 225 CFX_ByteStringC GetResult() const { return m_Buffer.AsStringC(); }
226 226
227 protected: 227 protected:
228 CFX_ByteTextBuf m_Buffer; 228 CFX_ByteTextBuf m_Buffer;
229 }; 229 };
230 230
231 class CFX_BasicArray { 231 class CFX_BasicArray {
232 protected: 232 protected:
233 CFX_BasicArray(int unit_size); 233 CFX_BasicArray(int unit_size);
234 234
235 ~CFX_BasicArray(); 235 ~CFX_BasicArray();
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
1058 FX_FLOAT c; 1058 FX_FLOAT c;
1059 FX_FLOAT d; 1059 FX_FLOAT d;
1060 FX_FLOAT e; 1060 FX_FLOAT e;
1061 FX_FLOAT f; 1061 FX_FLOAT f;
1062 FX_FLOAT g; 1062 FX_FLOAT g;
1063 FX_FLOAT h; 1063 FX_FLOAT h;
1064 FX_FLOAT i; 1064 FX_FLOAT i;
1065 }; 1065 };
1066 1066
1067 #endif // CORE_FXCRT_INCLUDE_FX_BASIC_H_ 1067 #endif // CORE_FXCRT_INCLUDE_FX_BASIC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698