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