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 #ifndef CORE_FPDFAPI_EDIT_CPDF_STRINGARCHIVESTREAM_H_
6 #define CORE_FPDFAPI_EDIT_CPDF_STRINGARCHIVESTREAM_H_
7 
8 #include "core/fxcrt/fx_stream.h"
9 
10 class CPDF_StringArchiveStream final : public IFX_ArchiveStream {
11  public:
12   explicit CPDF_StringArchiveStream(std::ostringstream* stream);
13   ~CPDF_StringArchiveStream() override;
14 
15   // IFX_ArchiveStream
16   bool WriteByte(uint8_t byte) override;
17   bool WriteDWord(uint32_t i) override;
18   FX_FILESIZE CurrentOffset() const override;
19   bool WriteBlock(const void* pData, size_t size) override;
20   bool WriteString(ByteStringView str) override;
21 
22  private:
23   std::ostringstream* stream_;
24 };
25 
26 #endif  // CORE_FPDFAPI_EDIT_CPDF_STRINGARCHIVESTREAM_H_
27