• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2018 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "core/fpdfapi/edit/cpdf_stringarchivestream.h"
6 
CPDF_StringArchiveStream(std::ostringstream * stream)7 CPDF_StringArchiveStream::CPDF_StringArchiveStream(std::ostringstream* stream)
8     : stream_(stream) {}
9 
~CPDF_StringArchiveStream()10 CPDF_StringArchiveStream::~CPDF_StringArchiveStream() {}
11 
WriteByte(uint8_t byte)12 bool CPDF_StringArchiveStream::WriteByte(uint8_t byte) {
13   NOTREACHED();
14   return false;
15 }
16 
WriteDWord(uint32_t i)17 bool CPDF_StringArchiveStream::WriteDWord(uint32_t i) {
18   NOTREACHED();
19   return false;
20 }
21 
CurrentOffset() const22 FX_FILESIZE CPDF_StringArchiveStream::CurrentOffset() const {
23   NOTREACHED();
24   return false;
25 }
26 
WriteBlock(const void * pData,size_t size)27 bool CPDF_StringArchiveStream::WriteBlock(const void* pData, size_t size) {
28   stream_->write(static_cast<const char*>(pData), size);
29   return true;
30 }
31 
WriteString(ByteStringView str)32 bool CPDF_StringArchiveStream::WriteString(ByteStringView str) {
33   stream_->write(str.unterminated_c_str(), str.GetLength());
34   return true;
35 }
36