1 // Copyright 2017 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 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #ifndef CORE_FPDFAPI_PARSER_CPDF_SEEKABLEMULTISTREAM_H_ 8 #define CORE_FPDFAPI_PARSER_CPDF_SEEKABLEMULTISTREAM_H_ 9 10 #include <vector> 11 12 #include "core/fxcrt/fx_stream.h" 13 #include "core/fxcrt/retain_ptr.h" 14 15 class CPDF_Stream; 16 class CPDF_StreamAcc; 17 18 class CPDF_SeekableMultiStream final : public IFX_SeekableStream { 19 public: 20 explicit CPDF_SeekableMultiStream( 21 const std::vector<const CPDF_Stream*>& streams); 22 ~CPDF_SeekableMultiStream() override; 23 24 // IFX_SeekableReadStream 25 FX_FILESIZE GetPosition() override; 26 FX_FILESIZE GetSize() override; 27 bool ReadBlockAtOffset(void* buffer, 28 FX_FILESIZE offset, 29 size_t size) override; 30 size_t ReadBlock(void* buffer, size_t size) override; 31 bool IsEOF() override; 32 bool Flush() override; 33 bool WriteBlockAtOffset(const void* pData, 34 FX_FILESIZE offset, 35 size_t size) override; 36 37 private: 38 std::vector<RetainPtr<CPDF_StreamAcc>> m_Data; 39 }; 40 41 #endif // CORE_FPDFAPI_PARSER_CPDF_SEEKABLEMULTISTREAM_H_ 42