OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef CORE_INCLUDE_FXCRT_FX_STREAM_H_ | 7 #ifndef CORE_INCLUDE_FXCRT_FX_STREAM_H_ |
8 #define CORE_INCLUDE_FXCRT_FX_STREAM_H_ | 8 #define CORE_INCLUDE_FXCRT_FX_STREAM_H_ |
9 | 9 |
10 #include "core/include/fxcrt/fx_string.h" | 10 #include "core/include/fxcrt/fx_string.h" |
11 | 11 |
12 void* FX_OpenFolder(const FX_CHAR* path); | 12 void* FX_OpenFolder(const FX_CHAR* path); |
13 void* FX_OpenFolder(const FX_WCHAR* path); | 13 void* FX_OpenFolder(const FX_WCHAR* path); |
14 FX_BOOL FX_GetNextFile(void* handle, | 14 FX_BOOL FX_GetNextFile(void* handle, |
15 CFX_ByteString& filename, | 15 CFX_ByteString& filename, |
16 FX_BOOL& bFolder); | 16 FX_BOOL& bFolder); |
17 FX_BOOL FX_GetNextFile(void* handle, | 17 FX_BOOL FX_GetNextFile(void* handle, |
18 CFX_WideString& filename, | 18 CFX_WideString& filename, |
19 FX_BOOL& bFolder); | 19 FX_BOOL& bFolder); |
20 void FX_CloseFolder(void* handle); | 20 void FX_CloseFolder(void* handle); |
21 FX_WCHAR FX_GetFolderSeparator(); | 21 FX_WCHAR FX_GetFolderSeparator(); |
22 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 22 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
23 #define FX_FILESIZE int32_t | 23 #define FX_FILESIZE int32_t |
24 #else | 24 #else |
25 #include <fcntl.h> | 25 #include <fcntl.h> |
| 26 #include <sys/stat.h> |
26 #include <unistd.h> | 27 #include <unistd.h> |
27 #include <sys/stat.h> | |
28 #ifndef O_BINARY | 28 #ifndef O_BINARY |
29 #define O_BINARY 0 | 29 #define O_BINARY 0 |
30 #endif | 30 #endif |
31 #ifndef O_LARGEFILE | 31 #ifndef O_LARGEFILE |
32 #define O_LARGEFILE 0 | 32 #define O_LARGEFILE 0 |
33 #endif | 33 #endif |
34 #define FX_FILESIZE off_t | 34 #define FX_FILESIZE off_t |
35 #endif | 35 #endif |
36 #define FX_GETBYTEOFFSET32(a) 0 | 36 #define FX_GETBYTEOFFSET32(a) 0 |
37 #define FX_GETBYTEOFFSET40(a) 0 | 37 #define FX_GETBYTEOFFSET40(a) 0 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 FX_FILESIZE GetPosition() override = 0; | 154 FX_FILESIZE GetPosition() override = 0; |
155 size_t ReadBlock(void* buffer, size_t size) override = 0; | 155 size_t ReadBlock(void* buffer, size_t size) override = 0; |
156 | 156 |
157 virtual FX_BOOL ReadNextBlock(FX_BOOL bRestart = FALSE) = 0; | 157 virtual FX_BOOL ReadNextBlock(FX_BOOL bRestart = FALSE) = 0; |
158 virtual const uint8_t* GetBlockBuffer() = 0; | 158 virtual const uint8_t* GetBlockBuffer() = 0; |
159 virtual size_t GetBlockSize() = 0; | 159 virtual size_t GetBlockSize() = 0; |
160 virtual FX_FILESIZE GetBlockOffset() = 0; | 160 virtual FX_FILESIZE GetBlockOffset() = 0; |
161 }; | 161 }; |
162 | 162 |
163 #endif // CORE_INCLUDE_FXCRT_FX_STREAM_H_ | 163 #endif // CORE_INCLUDE_FXCRT_FX_STREAM_H_ |
OLD | NEW |