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 "fx_string.h" | 10 #include "fx_string.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 class IFX_FileRead : IFX_StreamRead { | 93 class IFX_FileRead : IFX_StreamRead { |
94 public: | 94 public: |
95 virtual void Release() = 0; | 95 virtual void Release() = 0; |
96 | 96 |
97 virtual FX_FILESIZE GetSize() = 0; | 97 virtual FX_FILESIZE GetSize() = 0; |
98 | 98 |
99 virtual FX_BOOL IsEOF() { return FALSE; } | 99 virtual FX_BOOL IsEOF() { return FALSE; } |
100 | 100 |
101 virtual FX_FILESIZE GetPosition() { return 0; } | 101 virtual FX_FILESIZE GetPosition() { return 0; } |
102 | 102 |
103 virtual FX_BOOL SetRange(FX_FILESIZE offset, FX_FILESIZE size) { | |
104 return FALSE; | |
105 } | |
106 | |
107 virtual void ClearRange() {} | |
108 | |
109 virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) = 0; | 103 virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) = 0; |
110 | 104 |
111 virtual size_t ReadBlock(void* buffer, size_t size) { return 0; } | 105 virtual size_t ReadBlock(void* buffer, size_t size) { return 0; } |
112 }; | 106 }; |
113 IFX_FileRead* FX_CreateFileRead(const FX_CHAR* filename); | 107 IFX_FileRead* FX_CreateFileRead(const FX_CHAR* filename); |
114 IFX_FileRead* FX_CreateFileRead(const FX_WCHAR* filename); | 108 IFX_FileRead* FX_CreateFileRead(const FX_WCHAR* filename); |
115 class IFX_FileStream : public IFX_FileRead, public IFX_FileWrite { | 109 class IFX_FileStream : public IFX_FileRead, public IFX_FileWrite { |
116 public: | 110 public: |
117 virtual IFX_FileStream* Retain() = 0; | 111 virtual IFX_FileStream* Retain() = 0; |
118 | 112 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 virtual FX_BOOL ReadNextBlock(FX_BOOL bRestart = FALSE) = 0; | 164 virtual FX_BOOL ReadNextBlock(FX_BOOL bRestart = FALSE) = 0; |
171 | 165 |
172 virtual const uint8_t* GetBlockBuffer() = 0; | 166 virtual const uint8_t* GetBlockBuffer() = 0; |
173 | 167 |
174 virtual size_t GetBlockSize() = 0; | 168 virtual size_t GetBlockSize() = 0; |
175 | 169 |
176 virtual FX_FILESIZE GetBlockOffset() = 0; | 170 virtual FX_FILESIZE GetBlockOffset() = 0; |
177 }; | 171 }; |
178 | 172 |
179 #endif // CORE_INCLUDE_FXCRT_FX_STREAM_H_ | 173 #endif // CORE_INCLUDE_FXCRT_FX_STREAM_H_ |
OLD | NEW |