summaryrefslogtreecommitdiff
path: root/core/fxcrt/fileaccess_iface.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-03-06 18:53:05 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-03-06 18:53:05 +0000
commita32145f1f16b7b02110bf359208f587d7d486551 (patch)
treec97a9fbd14c9996e4bb8ceaa5167f0212b17f62c /core/fxcrt/fileaccess_iface.h
parent9600a771999de20fb22130cdb97088591508f89f (diff)
downloadpdfium-a32145f1f16b7b02110bf359208f587d7d486551.tar.xz
Rename core/fxcrt IFX files to Iface
This CL renames the 3 IFX files in core/fxcrt to Iface instead. Change-Id: I7cee6836650b71bc5c5729a8147fda62f0910fe3 Reviewed-on: https://pdfium-review.googlesource.com/27970 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcrt/fileaccess_iface.h')
-rw-r--r--core/fxcrt/fileaccess_iface.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/core/fxcrt/fileaccess_iface.h b/core/fxcrt/fileaccess_iface.h
new file mode 100644
index 0000000000..c438f9ec47
--- /dev/null
+++ b/core/fxcrt/fileaccess_iface.h
@@ -0,0 +1,38 @@
+// 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_FILEACCESS_IFACE_H_
+#define CORE_FXCRT_FILEACCESS_IFACE_H_
+
+#include <algorithm>
+#include <memory>
+
+#include "core/fxcrt/fx_safe_types.h"
+#include "core/fxcrt/fx_stream.h"
+#include "core/fxcrt/fx_string.h"
+
+class FileAccessIface {
+ public:
+ static std::unique_ptr<FileAccessIface> Create();
+ virtual ~FileAccessIface() {}
+
+ virtual bool Open(const ByteStringView& fileName, uint32_t dwMode) = 0;
+ virtual bool Open(const WideStringView& 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_FILEACCESS_IFACE_H_