• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_FXCRT_CFX_SEEKABLEMULTISTREAM_H_
8 #define CORE_FXCRT_CFX_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 CFX_SeekableMultiStream : public IFX_SeekableStream {
19  public:
20   explicit CFX_SeekableMultiStream(const std::vector<CPDF_Stream*>& streams);
21   ~CFX_SeekableMultiStream() override;
22 
23   // IFX_SeekableReadStream
24   FX_FILESIZE GetPosition() override;
25   FX_FILESIZE GetSize() override;
26   bool ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override;
27   size_t ReadBlock(void* buffer, size_t size) override;
28   bool IsEOF() override;
29   bool Flush() override;
30   bool WriteBlock(const void* pData, FX_FILESIZE offset, size_t size) override;
31 
32  private:
33   std::vector<RetainPtr<CPDF_StreamAcc>> m_Data;
34 };
35 
36 #endif  // CORE_FXCRT_CFX_SEEKABLEMULTISTREAM_H_
37