1 // Copyright 2018 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 FPDFSDK_CPDFSDK_CUSTOMACCESS_H_ 8 #define FPDFSDK_CPDFSDK_CUSTOMACCESS_H_ 9 10 #include "core/fxcrt/fx_stream.h" 11 #include "public/fpdfview.h" 12 13 class CPDFSDK_CustomAccess final : public IFX_SeekableReadStream { 14 public: 15 template <typename T, typename... Args> 16 friend RetainPtr<T> pdfium::MakeRetain(Args&&... args); 17 18 // IFX_SeekableReadStream 19 FX_FILESIZE GetSize() override; 20 bool ReadBlockAtOffset(void* buffer, 21 FX_FILESIZE offset, 22 size_t size) override; 23 24 private: 25 explicit CPDFSDK_CustomAccess(FPDF_FILEACCESS* pFileAccess); 26 ~CPDFSDK_CustomAccess() override; 27 28 FPDF_FILEACCESS m_FileAccess; 29 }; 30 31 #endif // FPDFSDK_CPDFSDK_CUSTOMACCESS_H_ 32