1 // Copyright 2018 The PDFium Authors 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 #include "core/fxcrt/fx_string_wrappers.h" 10 11 class CPDF_StringArchiveStream final : public IFX_ArchiveStream { 12 public: 13 explicit CPDF_StringArchiveStream(fxcrt::ostringstream* stream); 14 ~CPDF_StringArchiveStream() override; 15 16 // IFX_ArchiveStream: 17 bool WriteBlock(pdfium::span<const uint8_t> buffer) override; 18 FX_FILESIZE CurrentOffset() const override; 19 20 private: 21 fxcrt::ostringstream* stream_; 22 }; 23 24 #endif // CORE_FPDFAPI_EDIT_CPDF_STRINGARCHIVESTREAM_H_ 25