1 // Copyright 2014 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 CORE_FXCRT_CFX_FILEACCESS_WINDOWS_H_
8 #define CORE_FXCRT_CFX_FILEACCESS_WINDOWS_H_
9 
10 #include "core/fxcrt/ifx_fileaccess.h"
11 
12 #if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_
13 class CFX_FileAccess_Windows : public IFX_FileAccess {
14  public:
15   CFX_FileAccess_Windows();
16   ~CFX_FileAccess_Windows() override;
17 
18   // IFX_FileAccess
19   bool Open(const ByteStringView& fileName, uint32_t dwMode) override;
20   bool Open(const WideStringView& fileName, uint32_t dwMode) override;
21   void Close() override;
22   FX_FILESIZE GetSize() const override;
23   FX_FILESIZE GetPosition() const override;
24   FX_FILESIZE SetPosition(FX_FILESIZE pos) override;
25   size_t Read(void* pBuffer, size_t szBuffer) override;
26   size_t Write(const void* pBuffer, size_t szBuffer) override;
27   size_t ReadPos(void* pBuffer, size_t szBuffer, FX_FILESIZE pos) override;
28   size_t WritePos(const void* pBuffer,
29                   size_t szBuffer,
30                   FX_FILESIZE pos) override;
31   bool Flush() override;
32   bool Truncate(FX_FILESIZE szFile) override;
33 
34  protected:
35   void* m_hFile;
36 };
37 #endif
38 
39 #endif  // CORE_FXCRT_CFX_FILEACCESS_WINDOWS_H_
40