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_FXCRT_INCLUDE_FX_STREAM_H_ | 7 #ifndef CORE_FXCRT_INCLUDE_FX_STREAM_H_ |
8 #define CORE_FXCRT_INCLUDE_FX_STREAM_H_ | 8 #define CORE_FXCRT_INCLUDE_FX_STREAM_H_ |
9 | 9 |
10 #include "core/fxcrt/include/fx_string.h" | 10 #include "core/fxcrt/include/fx_string.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 FX_FILESIZE GetSize() override = 0; | 107 FX_FILESIZE GetSize() override = 0; |
108 | 108 |
109 // IFX_FileWrite: | 109 // IFX_FileWrite: |
110 FX_BOOL WriteBlock(const void* buffer, | 110 FX_BOOL WriteBlock(const void* buffer, |
111 FX_FILESIZE offset, | 111 FX_FILESIZE offset, |
112 size_t size) override = 0; | 112 size_t size) override = 0; |
113 FX_BOOL WriteBlock(const void* buffer, size_t size) override; | 113 FX_BOOL WriteBlock(const void* buffer, size_t size) override; |
114 FX_BOOL Flush() override = 0; | 114 FX_BOOL Flush() override = 0; |
115 }; | 115 }; |
116 | 116 |
117 IFX_FileStream* FX_CreateFileStream(const FX_CHAR* filename, FX_DWORD dwModes); | 117 IFX_FileStream* FX_CreateFileStream(const FX_CHAR* filename, uint32_t dwModes); |
118 IFX_FileStream* FX_CreateFileStream(const FX_WCHAR* filename, FX_DWORD dwModes); | 118 IFX_FileStream* FX_CreateFileStream(const FX_WCHAR* filename, uint32_t dwModes); |
119 | 119 |
120 #ifdef PDF_ENABLE_XFA | 120 #ifdef PDF_ENABLE_XFA |
121 class IFX_FileAccess { | 121 class IFX_FileAccess { |
122 public: | 122 public: |
123 virtual ~IFX_FileAccess() {} | 123 virtual ~IFX_FileAccess() {} |
124 virtual void Release() = 0; | 124 virtual void Release() = 0; |
125 virtual IFX_FileAccess* Retain() = 0; | 125 virtual IFX_FileAccess* Retain() = 0; |
126 virtual void GetPath(CFX_WideString& wsPath) = 0; | 126 virtual void GetPath(CFX_WideString& wsPath) = 0; |
127 virtual IFX_FileStream* CreateFileStream(FX_DWORD dwModes) = 0; | 127 virtual IFX_FileStream* CreateFileStream(uint32_t dwModes) = 0; |
128 }; | 128 }; |
129 IFX_FileAccess* FX_CreateDefaultFileAccess(const CFX_WideStringC& wsPath); | 129 IFX_FileAccess* FX_CreateDefaultFileAccess(const CFX_WideStringC& wsPath); |
130 #endif // PDF_ENABLE_XFA | 130 #endif // PDF_ENABLE_XFA |
131 | 131 |
132 class IFX_MemoryStream : public IFX_FileStream { | 132 class IFX_MemoryStream : public IFX_FileStream { |
133 public: | 133 public: |
134 virtual FX_BOOL IsConsecutive() const = 0; | 134 virtual FX_BOOL IsConsecutive() const = 0; |
135 virtual void EstimateSize(size_t nInitSize, size_t nGrowSize) = 0; | 135 virtual void EstimateSize(size_t nInitSize, size_t nGrowSize) = 0; |
136 virtual uint8_t* GetBuffer() const = 0; | 136 virtual uint8_t* GetBuffer() const = 0; |
137 virtual void AttachBuffer(uint8_t* pBuffer, | 137 virtual void AttachBuffer(uint8_t* pBuffer, |
(...skipping 15 matching lines...) Expand all Loading... |
153 FX_FILESIZE GetPosition() override = 0; | 153 FX_FILESIZE GetPosition() override = 0; |
154 size_t ReadBlock(void* buffer, size_t size) override = 0; | 154 size_t ReadBlock(void* buffer, size_t size) override = 0; |
155 | 155 |
156 virtual FX_BOOL ReadNextBlock(FX_BOOL bRestart = FALSE) = 0; | 156 virtual FX_BOOL ReadNextBlock(FX_BOOL bRestart = FALSE) = 0; |
157 virtual const uint8_t* GetBlockBuffer() = 0; | 157 virtual const uint8_t* GetBlockBuffer() = 0; |
158 virtual size_t GetBlockSize() = 0; | 158 virtual size_t GetBlockSize() = 0; |
159 virtual FX_FILESIZE GetBlockOffset() = 0; | 159 virtual FX_FILESIZE GetBlockOffset() = 0; |
160 }; | 160 }; |
161 | 161 |
162 #endif // CORE_FXCRT_INCLUDE_FX_STREAM_H_ | 162 #endif // CORE_FXCRT_INCLUDE_FX_STREAM_H_ |
OLD | NEW |