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 <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "core/fxcrt/include/fx_basic.h" | 10 #include "core/fxcrt/include/fx_basic.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 CFX_WideTextBuf& CFX_WideTextBuf::operator<<(const FX_WCHAR* lpsz) { | 179 CFX_WideTextBuf& CFX_WideTextBuf::operator<<(const FX_WCHAR* lpsz) { |
180 AppendBlock(lpsz, FXSYS_wcslen(lpsz) * sizeof(FX_WCHAR)); | 180 AppendBlock(lpsz, FXSYS_wcslen(lpsz) * sizeof(FX_WCHAR)); |
181 return *this; | 181 return *this; |
182 } | 182 } |
183 | 183 |
184 CFX_WideTextBuf& CFX_WideTextBuf::operator<<(const CFX_WideTextBuf& buf) { | 184 CFX_WideTextBuf& CFX_WideTextBuf::operator<<(const CFX_WideTextBuf& buf) { |
185 AppendBlock(buf.m_pBuffer.get(), buf.m_DataSize); | 185 AppendBlock(buf.m_pBuffer.get(), buf.m_DataSize); |
186 return *this; | 186 return *this; |
187 } | 187 } |
188 | 188 |
189 CFX_WideStringC CFX_WideTextBuf::AsStringC() const { | |
190 return CFX_WideStringC(reinterpret_cast<const FX_WCHAR*>(m_pBuffer.get()), | |
191 m_DataSize / sizeof(FX_WCHAR)); | |
192 } | |
193 | |
194 #ifdef PDF_ENABLE_XFA | 189 #ifdef PDF_ENABLE_XFA |
195 CFX_ArchiveSaver& CFX_ArchiveSaver::operator<<(uint8_t i) { | 190 CFX_ArchiveSaver& CFX_ArchiveSaver::operator<<(uint8_t i) { |
196 if (m_pStream) { | 191 if (m_pStream) { |
197 m_pStream->WriteBlock(&i, 1); | 192 m_pStream->WriteBlock(&i, 1); |
198 } else { | 193 } else { |
199 m_SavingBuf.AppendByte(i); | 194 m_SavingBuf.AppendByte(i); |
200 } | 195 } |
201 return *this; | 196 return *this; |
202 } | 197 } |
203 CFX_ArchiveSaver& CFX_ArchiveSaver::operator<<(int i) { | 198 CFX_ArchiveSaver& CFX_ArchiveSaver::operator<<(int i) { |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 } | 414 } |
420 | 415 |
421 int32_t CFX_FileBufferArchive::AppendString(const CFX_ByteStringC& lpsz) { | 416 int32_t CFX_FileBufferArchive::AppendString(const CFX_ByteStringC& lpsz) { |
422 return AppendBlock(lpsz.raw_str(), lpsz.GetLength()); | 417 return AppendBlock(lpsz.raw_str(), lpsz.GetLength()); |
423 } | 418 } |
424 | 419 |
425 void CFX_FileBufferArchive::AttachFile(IFX_StreamWrite* pFile) { | 420 void CFX_FileBufferArchive::AttachFile(IFX_StreamWrite* pFile) { |
426 ASSERT(pFile); | 421 ASSERT(pFile); |
427 m_pFile = pFile; | 422 m_pFile = pFile; |
428 } | 423 } |
OLD | NEW |