| 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_FX_STREAM_H_ | 7 #ifndef CORE_FXCRT_FX_STREAM_H_ |
| 8 #define CORE_FXCRT_FX_STREAM_H_ | 8 #define CORE_FXCRT_FX_STREAM_H_ |
| 9 | 9 |
| 10 #include "core/fxcrt/fx_string.h" | 10 #include "core/fxcrt/fx_string.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 IFX_FileAccess* FX_CreateDefaultFileAccess(const CFX_WideStringC& wsPath); | 136 IFX_FileAccess* FX_CreateDefaultFileAccess(const CFX_WideStringC& wsPath); |
| 137 #endif // PDF_ENABLE_XFA | 137 #endif // PDF_ENABLE_XFA |
| 138 | 138 |
| 139 class IFX_MemoryStream : public IFX_SeekableStream { | 139 class IFX_MemoryStream : public IFX_SeekableStream { |
| 140 public: | 140 public: |
| 141 virtual bool IsConsecutive() const = 0; | 141 virtual bool IsConsecutive() const = 0; |
| 142 virtual void EstimateSize(size_t nInitSize, size_t nGrowSize) = 0; | 142 virtual void EstimateSize(size_t nInitSize, size_t nGrowSize) = 0; |
| 143 virtual uint8_t* GetBuffer() const = 0; | 143 virtual uint8_t* GetBuffer() const = 0; |
| 144 virtual void AttachBuffer(uint8_t* pBuffer, | 144 virtual void AttachBuffer(uint8_t* pBuffer, |
| 145 size_t nSize, | 145 size_t nSize, |
| 146 bool bTakeOver = FALSE) = 0; | 146 bool bTakeOver = false) = 0; |
| 147 virtual void DetachBuffer() = 0; | 147 virtual void DetachBuffer() = 0; |
| 148 }; | 148 }; |
| 149 | 149 |
| 150 IFX_MemoryStream* FX_CreateMemoryStream(uint8_t* pBuffer, | 150 IFX_MemoryStream* FX_CreateMemoryStream(uint8_t* pBuffer, |
| 151 size_t nSize, | 151 size_t nSize, |
| 152 bool bTakeOver = FALSE); | 152 bool bTakeOver = false); |
| 153 IFX_MemoryStream* FX_CreateMemoryStream(bool bConsecutive = FALSE); | 153 IFX_MemoryStream* FX_CreateMemoryStream(bool bConsecutive = false); |
| 154 | 154 |
| 155 class IFX_BufferRead : public IFX_ReadStream { | 155 class IFX_BufferRead : public IFX_ReadStream { |
| 156 public: | 156 public: |
| 157 // IFX_ReadStream: | 157 // IFX_ReadStream: |
| 158 void Release() override = 0; | 158 void Release() override = 0; |
| 159 bool IsEOF() override = 0; | 159 bool IsEOF() override = 0; |
| 160 FX_FILESIZE GetPosition() override = 0; | 160 FX_FILESIZE GetPosition() override = 0; |
| 161 size_t ReadBlock(void* buffer, size_t size) override = 0; | 161 size_t ReadBlock(void* buffer, size_t size) override = 0; |
| 162 | 162 |
| 163 virtual bool ReadNextBlock(bool bRestart = FALSE) = 0; | 163 virtual bool ReadNextBlock(bool bRestart = false) = 0; |
| 164 virtual const uint8_t* GetBlockBuffer() = 0; | 164 virtual const uint8_t* GetBlockBuffer() = 0; |
| 165 virtual size_t GetBlockSize() = 0; | 165 virtual size_t GetBlockSize() = 0; |
| 166 virtual FX_FILESIZE GetBlockOffset() = 0; | 166 virtual FX_FILESIZE GetBlockOffset() = 0; |
| 167 }; | 167 }; |
| 168 | 168 |
| 169 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 169 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
| 170 class CFindFileData { | 170 class CFindFileData { |
| 171 public: | 171 public: |
| 172 virtual ~CFindFileData() {} | 172 virtual ~CFindFileData() {} |
| 173 HANDLE m_Handle; | 173 HANDLE m_Handle; |
| 174 bool m_bEnd; | 174 bool m_bEnd; |
| 175 }; | 175 }; |
| 176 | 176 |
| 177 class CFindFileDataA : public CFindFileData { | 177 class CFindFileDataA : public CFindFileData { |
| 178 public: | 178 public: |
| 179 ~CFindFileDataA() override {} | 179 ~CFindFileDataA() override {} |
| 180 WIN32_FIND_DATAA m_FindData; | 180 WIN32_FIND_DATAA m_FindData; |
| 181 }; | 181 }; |
| 182 | 182 |
| 183 class CFindFileDataW : public CFindFileData { | 183 class CFindFileDataW : public CFindFileData { |
| 184 public: | 184 public: |
| 185 ~CFindFileDataW() override {} | 185 ~CFindFileDataW() override {} |
| 186 WIN32_FIND_DATAW m_FindData; | 186 WIN32_FIND_DATAW m_FindData; |
| 187 }; | 187 }; |
| 188 #endif | 188 #endif |
| 189 | 189 |
| 190 #endif // CORE_FXCRT_FX_STREAM_H_ | 190 #endif // CORE_FXCRT_FX_STREAM_H_ |
| OLD | NEW |