| 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 "../../include/fxcrt/fx_basic.h" |
| 8 FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_LPSTR buf); | 8 FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_LPSTR buf); |
| 9 CFX_BinaryBuf::CFX_BinaryBuf() | 9 CFX_BinaryBuf::CFX_BinaryBuf() |
| 10 : m_AllocStep(0) | 10 : m_AllocStep(0) |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 *(FX_WCHAR*)(m_pBuffer + m_DataSize) = ch; | 185 *(FX_WCHAR*)(m_pBuffer + m_DataSize) = ch; |
| 186 m_DataSize += sizeof(FX_WCHAR); | 186 m_DataSize += sizeof(FX_WCHAR); |
| 187 } | 187 } |
| 188 CFX_WideTextBuf& CFX_WideTextBuf::operator << (FX_WSTR str) | 188 CFX_WideTextBuf& CFX_WideTextBuf::operator << (FX_WSTR str) |
| 189 { | 189 { |
| 190 AppendBlock(str.GetPtr(), str.GetLength() * sizeof(FX_WCHAR)); | 190 AppendBlock(str.GetPtr(), str.GetLength() * sizeof(FX_WCHAR)); |
| 191 return *this; | 191 return *this; |
| 192 } | 192 } |
| 193 CFX_WideTextBuf& CFX_WideTextBuf::operator << (const CFX_WideString &str) | 193 CFX_WideTextBuf& CFX_WideTextBuf::operator << (const CFX_WideString &str) |
| 194 { | 194 { |
| 195 AppendBlock((FX_LPCWSTR)str, str.GetLength() * sizeof(FX_WCHAR)); | 195 AppendBlock(str.c_str(), str.GetLength() * sizeof(FX_WCHAR)); |
| 196 return *this; | 196 return *this; |
| 197 } | 197 } |
| 198 CFX_WideTextBuf& CFX_WideTextBuf::operator << (int i) | 198 CFX_WideTextBuf& CFX_WideTextBuf::operator << (int i) |
| 199 { | 199 { |
| 200 char buf[32]; | 200 char buf[32]; |
| 201 FXSYS_itoa(i, buf, 10); | 201 FXSYS_itoa(i, buf, 10); |
| 202 FX_STRSIZE len = (FX_STRSIZE)FXSYS_strlen(buf); | 202 FX_STRSIZE len = (FX_STRSIZE)FXSYS_strlen(buf); |
| 203 if (m_AllocSize < m_DataSize + (FX_STRSIZE)(len * sizeof(FX_WCHAR))) { | 203 if (m_AllocSize < m_DataSize + (FX_STRSIZE)(len * sizeof(FX_WCHAR))) { |
| 204 ExpandBuf(len * sizeof(FX_WCHAR)); | 204 ExpandBuf(len * sizeof(FX_WCHAR)); |
| 205 } | 205 } |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 FX_BOOL CFX_FileBufferArchive::DoWork(const void* pBuf, size_t size) | 554 FX_BOOL CFX_FileBufferArchive::DoWork(const void* pBuf, size_t size) |
| 555 { | 555 { |
| 556 if (!m_pFile) { | 556 if (!m_pFile) { |
| 557 return FALSE; | 557 return FALSE; |
| 558 } | 558 } |
| 559 if (!pBuf || size < 1) { | 559 if (!pBuf || size < 1) { |
| 560 return TRUE; | 560 return TRUE; |
| 561 } | 561 } |
| 562 return m_pFile->WriteBlock(pBuf, size); | 562 return m_pFile->WriteBlock(pBuf, size); |
| 563 } | 563 } |
| OLD | NEW |