Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
fileaccess_iface.h
Go to the documentation of this file.
1// Copyright 2014 The PDFium Authors
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_FILEACCESS_IFACE_H_
8#define CORE_FXCRT_FILEACCESS_IFACE_H_
9
10#include <memory>
11
12#include "core/fxcrt/fx_string.h"
13
15 public:
17 virtual ~FileAccessIface() = default;
18
19 // Opens in read-only mode. `fileName` is UTF-8 on all platforms.
20 virtual bool Open(ByteStringView fileName) = 0;
21 virtual void Close() = 0;
22 virtual FX_FILESIZE GetSize() const = 0;
23 virtual FX_FILESIZE GetPosition() const = 0;
25 virtual size_t Read(void* pBuffer, size_t szBuffer) = 0;
26 virtual size_t Write(const void* pBuffer, size_t szBuffer) = 0;
27 virtual size_t ReadPos(void* pBuffer, size_t szBuffer, FX_FILESIZE pos) = 0;
28 virtual size_t WritePos(const void* pBuffer,
29 size_t szBuffer,
30 FX_FILESIZE pos) = 0;
31 virtual bool Flush() = 0;
32 virtual bool Truncate(FX_FILESIZE szFile) = 0;
33};
34
35#endif // CORE_FXCRT_FILEACCESS_IFACE_H_
#define O_LARGEFILE
#define O_BINARY
size_t ReadPos(void *pBuffer, size_t szBuffer, FX_FILESIZE pos) override
size_t Write(const void *pBuffer, size_t szBuffer) override
FX_FILESIZE GetSize() const override
size_t WritePos(const void *pBuffer, size_t szBuffer, FX_FILESIZE pos) override
size_t Read(void *pBuffer, size_t szBuffer) override
FX_FILESIZE SetPosition(FX_FILESIZE pos) override
bool Open(ByteStringView fileName) override
bool Truncate(FX_FILESIZE szFile) override
FX_FILESIZE GetPosition() const override
virtual size_t WritePos(const void *pBuffer, size_t szBuffer, FX_FILESIZE pos)=0
virtual FX_FILESIZE SetPosition(FX_FILESIZE pos)=0
virtual FX_FILESIZE GetPosition() const =0
virtual size_t ReadPos(void *pBuffer, size_t szBuffer, FX_FILESIZE pos)=0
virtual bool Open(ByteStringView fileName)=0
virtual size_t Write(const void *pBuffer, size_t szBuffer)=0
virtual void Close()=0
virtual ~FileAccessIface()=default
virtual bool Flush()=0
virtual FX_FILESIZE GetSize() const =0
virtual size_t Read(void *pBuffer, size_t szBuffer)=0
static std::unique_ptr< FileAccessIface > Create()
virtual bool Truncate(FX_FILESIZE szFile)=0
#define FX_FILESIZE
Definition fx_types.h:19