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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 size_t size) override = 0; | 120 size_t size) override = 0; |
121 FX_BOOL WriteBlock(const void* buffer, size_t size) override { | 121 FX_BOOL WriteBlock(const void* buffer, size_t size) override { |
122 return WriteBlock(buffer, GetSize(), size); | 122 return WriteBlock(buffer, GetSize(), size); |
123 } | 123 } |
124 FX_BOOL Flush() override = 0; | 124 FX_BOOL Flush() override = 0; |
125 }; | 125 }; |
126 | 126 |
127 IFX_FileStream* FX_CreateFileStream(const FX_CHAR* filename, FX_DWORD dwModes); | 127 IFX_FileStream* FX_CreateFileStream(const FX_CHAR* filename, FX_DWORD dwModes); |
128 IFX_FileStream* FX_CreateFileStream(const FX_WCHAR* filename, FX_DWORD dwModes); | 128 IFX_FileStream* FX_CreateFileStream(const FX_WCHAR* filename, FX_DWORD dwModes); |
129 | 129 |
| 130 #ifdef PDF_ENABLE_XFA |
| 131 class IFX_FileAccess { |
| 132 public: |
| 133 virtual ~IFX_FileAccess() {} |
| 134 virtual void Release() = 0; |
| 135 virtual IFX_FileAccess* Retain() = 0; |
| 136 virtual void GetPath(CFX_WideString& wsPath) = 0; |
| 137 virtual IFX_FileStream* CreateFileStream(FX_DWORD dwModes) = 0; |
| 138 }; |
| 139 IFX_FileAccess* FX_CreateDefaultFileAccess(const CFX_WideStringC& wsPath); |
| 140 |
| 141 #endif |
130 class IFX_MemoryStream : public IFX_FileStream { | 142 class IFX_MemoryStream : public IFX_FileStream { |
131 public: | 143 public: |
132 virtual FX_BOOL IsConsecutive() const = 0; | 144 virtual FX_BOOL IsConsecutive() const = 0; |
133 | 145 |
134 virtual void EstimateSize(size_t nInitSize, size_t nGrowSize) = 0; | 146 virtual void EstimateSize(size_t nInitSize, size_t nGrowSize) = 0; |
135 | 147 |
136 virtual uint8_t* GetBuffer() const = 0; | 148 virtual uint8_t* GetBuffer() const = 0; |
137 | 149 |
138 virtual void AttachBuffer(uint8_t* pBuffer, | 150 virtual void AttachBuffer(uint8_t* pBuffer, |
139 size_t nSize, | 151 size_t nSize, |
(...skipping 13 matching lines...) Expand all Loading... |
153 FX_FILESIZE GetPosition() override = 0; | 165 FX_FILESIZE GetPosition() override = 0; |
154 size_t ReadBlock(void* buffer, size_t size) override = 0; | 166 size_t ReadBlock(void* buffer, size_t size) override = 0; |
155 | 167 |
156 virtual FX_BOOL ReadNextBlock(FX_BOOL bRestart = FALSE) = 0; | 168 virtual FX_BOOL ReadNextBlock(FX_BOOL bRestart = FALSE) = 0; |
157 virtual const uint8_t* GetBlockBuffer() = 0; | 169 virtual const uint8_t* GetBlockBuffer() = 0; |
158 virtual size_t GetBlockSize() = 0; | 170 virtual size_t GetBlockSize() = 0; |
159 virtual FX_FILESIZE GetBlockOffset() = 0; | 171 virtual FX_FILESIZE GetBlockOffset() = 0; |
160 }; | 172 }; |
161 | 173 |
162 #endif // CORE_INCLUDE_FXCRT_FX_STREAM_H_ | 174 #endif // CORE_INCLUDE_FXCRT_FX_STREAM_H_ |
OLD | NEW |