OLD | NEW |
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 #include "../../include/fxcrt/fx_basic.h" | 7 #include "core/include/fxcrt/fx_basic.h" |
| 8 |
8 FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_CHAR* buf); | 9 FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_CHAR* buf); |
9 CFX_BinaryBuf::CFX_BinaryBuf() | 10 CFX_BinaryBuf::CFX_BinaryBuf() |
10 : m_AllocStep(0), m_pBuffer(NULL), m_DataSize(0), m_AllocSize(0) {} | 11 : m_AllocStep(0), m_pBuffer(NULL), m_DataSize(0), m_AllocSize(0) {} |
11 CFX_BinaryBuf::CFX_BinaryBuf(FX_STRSIZE size) | 12 CFX_BinaryBuf::CFX_BinaryBuf(FX_STRSIZE size) |
12 : m_AllocStep(0), m_DataSize(size), m_AllocSize(size) { | 13 : m_AllocStep(0), m_DataSize(size), m_AllocSize(size) { |
13 m_pBuffer = FX_Alloc(uint8_t, size); | 14 m_pBuffer = FX_Alloc(uint8_t, size); |
14 } | 15 } |
15 CFX_BinaryBuf::~CFX_BinaryBuf() { | 16 CFX_BinaryBuf::~CFX_BinaryBuf() { |
16 FX_Free(m_pBuffer); | 17 FX_Free(m_pBuffer); |
17 } | 18 } |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 } | 324 } |
324 FX_BOOL CFX_FileBufferArchive::DoWork(const void* pBuf, size_t size) { | 325 FX_BOOL CFX_FileBufferArchive::DoWork(const void* pBuf, size_t size) { |
325 if (!m_pFile) { | 326 if (!m_pFile) { |
326 return FALSE; | 327 return FALSE; |
327 } | 328 } |
328 if (!pBuf || size < 1) { | 329 if (!pBuf || size < 1) { |
329 return TRUE; | 330 return TRUE; |
330 } | 331 } |
331 return m_pFile->WriteBlock(pBuf, size); | 332 return m_pFile->WriteBlock(pBuf, size); |
332 } | 333 } |
OLD | NEW |