From cfb1944e245e20fe2ce0e94feebc06526db34fa1 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 20 Apr 2017 13:13:04 -0400 Subject: Cleanup the fx_extension code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This CL cleans up the fx_extension file. The stream code was moved to fx_stream. IFX_FileAccess was removed and CFX_CRTFileAccess split to its own file. Code shuffled from header to cpp file. Change-Id: I700fdfcc9797cf4e8050cd9ba010ad8854feefbf Reviewed-on: https://pdfium-review.googlesource.com/4371 Reviewed-by: Nicolás Peña Commit-Queue: dsinclair --- core/fxcrt/ifxcrt_fileaccess.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 core/fxcrt/ifxcrt_fileaccess.h (limited to 'core/fxcrt/ifxcrt_fileaccess.h') diff --git a/core/fxcrt/ifxcrt_fileaccess.h b/core/fxcrt/ifxcrt_fileaccess.h new file mode 100644 index 0000000000..9528b3b377 --- /dev/null +++ b/core/fxcrt/ifxcrt_fileaccess.h @@ -0,0 +1,37 @@ +// Copyright 2014 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 CORE_FXCRT_IFXCRT_FILEACCESS_H_ +#define CORE_FXCRT_IFXCRT_FILEACCESS_H_ + +#include +#include + +#include "core/fxcrt/fx_basic.h" +#include "core/fxcrt/fx_safe_types.h" + +class IFXCRT_FileAccess { + public: + static IFXCRT_FileAccess* Create(); + virtual ~IFXCRT_FileAccess() {} + + virtual bool Open(const CFX_ByteStringC& fileName, uint32_t dwMode) = 0; + virtual bool Open(const CFX_WideStringC& fileName, uint32_t dwMode) = 0; + virtual void Close() = 0; + virtual FX_FILESIZE GetSize() const = 0; + virtual FX_FILESIZE GetPosition() const = 0; + virtual FX_FILESIZE SetPosition(FX_FILESIZE pos) = 0; + virtual size_t Read(void* pBuffer, size_t szBuffer) = 0; + virtual size_t Write(const void* pBuffer, size_t szBuffer) = 0; + virtual size_t ReadPos(void* pBuffer, size_t szBuffer, FX_FILESIZE pos) = 0; + virtual size_t WritePos(const void* pBuffer, + size_t szBuffer, + FX_FILESIZE pos) = 0; + virtual bool Flush() = 0; + virtual bool Truncate(FX_FILESIZE szFile) = 0; +}; + +#endif // CORE_FXCRT_IFXCRT_FILEACCESS_H_ -- cgit v1.2.3