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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 } | 447 } |
447 FX_BOOL CFX_FileBufferArchive::DoWork(const void* pBuf, size_t size) { | 448 FX_BOOL CFX_FileBufferArchive::DoWork(const void* pBuf, size_t size) { |
448 if (!m_pFile) { | 449 if (!m_pFile) { |
449 return FALSE; | 450 return FALSE; |
450 } | 451 } |
451 if (!pBuf || size < 1) { | 452 if (!pBuf || size < 1) { |
452 return TRUE; | 453 return TRUE; |
453 } | 454 } |
454 return m_pFile->WriteBlock(pBuf, size); | 455 return m_pFile->WriteBlock(pBuf, size); |
455 } | 456 } |
OLD | NEW |