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

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

Issue 1255113003: Kill CFX_ArchiveLoader / CFX_ArchiveSaver and subclasses (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 4 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/include/fpdfapi/fpdf_serial.h ('k') | core/src/fxcrt/fx_basic_buffer.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_INCLUDE_FXCRT_FX_BASIC_H_ 7 #ifndef CORE_INCLUDE_FXCRT_FX_BASIC_H_
8 #define CORE_INCLUDE_FXCRT_FX_BASIC_H_ 8 #define CORE_INCLUDE_FXCRT_FX_BASIC_H_
9 9
10 #include "fx_memory.h" 10 #include "fx_memory.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 return (FX_WCHAR*)m_pBuffer; 148 return (FX_WCHAR*)m_pBuffer;
149 } 149 }
150 150
151 void Delete(int start_index, int coun t) 151 void Delete(int start_index, int coun t)
152 { 152 {
153 CFX_BinaryBuf::Delete(start_index * sizeof(FX_WCHAR), count * sizeof(FX_ WCHAR)); 153 CFX_BinaryBuf::Delete(start_index * sizeof(FX_WCHAR), count * sizeof(FX_ WCHAR));
154 } 154 }
155 155
156 CFX_WideStringC GetWideString() const; 156 CFX_WideStringC GetWideString() const;
157 }; 157 };
158 class CFX_ArchiveSaver
159 {
160 public:
161 CFX_ArchiveSaver() : m_pStream(NULL) {}
162
163 CFX_ArchiveSaver& operator << (uint8_t i);
164
165 CFX_ArchiveSaver& operator << (int i);
166
167 CFX_ArchiveSaver& operator << (FX_DWORD i);
168
169 CFX_ArchiveSaver& operator << (FX_FLOAT i);
170
171 CFX_ArchiveSaver& operator << (double i);
172
173 CFX_ArchiveSaver& operator << (const CFX_ByteStringC& bstr);
174
175 CFX_ArchiveSaver& operator << (const FX_WCHAR* bstr);
176
177 CFX_ArchiveSaver& operator << (const CFX_WideString& wstr);
178
179 void Write(const void* pData, FX_STRS IZE dwSize);
180
181 intptr_t GetLength()
182 {
183 return m_SavingBuf.GetSize();
184 }
185
186 const uint8_t* GetBuffer()
187 {
188 return m_SavingBuf.GetBuffer();
189 }
190
191 void SetStream(IFX_FileStream* pStrea m)
192 {
193 m_pStream = pStream;
194 }
195 protected:
196
197 CFX_BinaryBuf m_SavingBuf;
198
199 IFX_FileStream* m_pStream;
200 };
201 class CFX_ArchiveLoader
202 {
203 public:
204
205 CFX_ArchiveLoader(const uint8_t* pData, FX_DWORD dwSize);
206
207 CFX_ArchiveLoader& operator >> (uint8_t& i);
208
209 CFX_ArchiveLoader& operator >> (int& i);
210
211 CFX_ArchiveLoader& operator >> (FX_DWORD& i);
212
213 CFX_ArchiveLoader& operator >> (FX_FLOAT& i);
214
215 CFX_ArchiveLoader& operator >> (double& i);
216
217 CFX_ArchiveLoader& operator >> (CFX_ByteString& bstr);
218
219 CFX_ArchiveLoader& operator >> (CFX_WideString& wstr);
220
221 FX_BOOL IsEOF();
222
223 FX_BOOL Read(void* pBuf, FX_DWORD dwSize );
224 protected:
225
226 FX_DWORD m_LoadingPos;
227
228 const uint8_t* m_pLoadingBuf;
229
230 FX_DWORD m_LoadingSize;
231
232 };
233 158
234 class IFX_BufferArchive 159 class IFX_BufferArchive
235 { 160 {
236 public: 161 public:
237 IFX_BufferArchive(FX_STRSIZE size); 162 IFX_BufferArchive(FX_STRSIZE size);
238 virtual ~IFX_BufferArchive() {} 163 virtual ~IFX_BufferArchive() {}
239 164
240 virtual void Clear(); 165 virtual void Clear();
241 166
242 FX_BOOL Flush(); 167 FX_BOOL Flush();
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after
1568 FX_FLOAT c; 1493 FX_FLOAT c;
1569 FX_FLOAT d; 1494 FX_FLOAT d;
1570 FX_FLOAT e; 1495 FX_FLOAT e;
1571 FX_FLOAT f; 1496 FX_FLOAT f;
1572 FX_FLOAT g; 1497 FX_FLOAT g;
1573 FX_FLOAT h; 1498 FX_FLOAT h;
1574 FX_FLOAT i; 1499 FX_FLOAT i;
1575 }; 1500 };
1576 1501
1577 #endif // CORE_INCLUDE_FXCRT_FX_BASIC_H_ 1502 #endif // CORE_INCLUDE_FXCRT_FX_BASIC_H_
OLDNEW
« no previous file with comments | « core/include/fpdfapi/fpdf_serial.h ('k') | core/src/fxcrt/fx_basic_buffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698