From 9d6a2089c93c94461289b21a29771039eace95e7 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 12 Apr 2017 11:32:32 -0400 Subject: Remove MakeSeekableReadStream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This Cl removes the MakeSeekableReadStream call and, at the one place it's used, creates an IFX_MemoryStream which is a seekable read stream. Change-Id: I6b0b23636eff47f8caca5432313ba99703e21e4d Reviewed-on: https://pdfium-review.googlesource.com/4037 Reviewed-by: Nicolás Peña Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- xfa/fxfa/cxfa_fileread.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 xfa/fxfa/cxfa_fileread.h (limited to 'xfa/fxfa/cxfa_fileread.h') diff --git a/xfa/fxfa/cxfa_fileread.h b/xfa/fxfa/cxfa_fileread.h new file mode 100644 index 0000000000..0c3348b8d5 --- /dev/null +++ b/xfa/fxfa/cxfa_fileread.h @@ -0,0 +1,31 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef XFA_FXFA_CXFA_FILEREAD_H_ +#define XFA_FXFA_CXFA_FILEREAD_H_ + +#include + +#include "core/fxcrt/cfx_retain_ptr.h" +#include "core/fxcrt/fx_stream.h" + +class CPDF_Stream; +class CPDF_StreamAcc; + +class CXFA_FileRead : public IFX_SeekableReadStream { + public: + explicit CXFA_FileRead(const std::vector& streams); + ~CXFA_FileRead() override; + + // IFX_SeekableReadStream + FX_FILESIZE GetSize() override; + bool ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override; + + private: + std::vector> m_Data; +}; + +#endif // XFA_FXFA_CXFA_FILEREAD_H_ -- cgit v1.2.3