Chromium Code Reviews| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 FX_BOOL FX_File_Copy(const CFX_WideStringC& fileNameSrc, | 53 FX_BOOL FX_File_Copy(const CFX_WideStringC& fileNameSrc, |
| 54 const CFX_WideStringC& fileNameDst); | 54 const CFX_WideStringC& fileNameDst); |
| 55 FX_BOOL FX_File_Move(const CFX_ByteStringC& fileNameSrc, | 55 FX_BOOL FX_File_Move(const CFX_ByteStringC& fileNameSrc, |
| 56 const CFX_ByteStringC& fileNameDst); | 56 const CFX_ByteStringC& fileNameDst); |
| 57 FX_BOOL FX_File_Move(const CFX_WideStringC& fileNameSrc, | 57 FX_BOOL FX_File_Move(const CFX_WideStringC& fileNameSrc, |
| 58 const CFX_WideStringC& fileNameDst); | 58 const CFX_WideStringC& fileNameDst); |
| 59 class IFX_StreamWrite { | 59 class IFX_StreamWrite { |
| 60 public: | 60 public: |
| 61 virtual ~IFX_StreamWrite() {} | 61 virtual ~IFX_StreamWrite() {} |
| 62 virtual void Release() = 0; | 62 virtual void Release() = 0; |
| 63 #ifndef PDF_ENABLE_XFA | |
|
Lei Zhang
2015/10/30 06:15:30
empty block
| |
| 63 | 64 |
| 65 #endif | |
| 64 virtual FX_BOOL WriteBlock(const void* pData, size_t size) = 0; | 66 virtual FX_BOOL WriteBlock(const void* pData, size_t size) = 0; |
| 65 }; | 67 }; |
| 66 class IFX_FileWrite : public IFX_StreamWrite { | 68 class IFX_FileWrite : public IFX_StreamWrite { |
| 67 public: | 69 public: |
| 68 virtual void Release() = 0; | 70 virtual void Release() = 0; |
| 69 | 71 |
| 70 virtual FX_FILESIZE GetSize() = 0; | 72 virtual FX_FILESIZE GetSize() = 0; |
| 71 | 73 |
| 72 virtual FX_BOOL Flush() = 0; | 74 virtual FX_BOOL Flush() = 0; |
| 73 | 75 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 FX_FILESIZE offset, | 128 FX_FILESIZE offset, |
| 127 size_t size) = 0; | 129 size_t size) = 0; |
| 128 virtual FX_BOOL WriteBlock(const void* buffer, size_t size) { | 130 virtual FX_BOOL WriteBlock(const void* buffer, size_t size) { |
| 129 return WriteBlock(buffer, GetSize(), size); | 131 return WriteBlock(buffer, GetSize(), size); |
| 130 } | 132 } |
| 131 | 133 |
| 132 virtual FX_BOOL Flush() = 0; | 134 virtual FX_BOOL Flush() = 0; |
| 133 }; | 135 }; |
| 134 IFX_FileStream* FX_CreateFileStream(const FX_CHAR* filename, FX_DWORD dwModes); | 136 IFX_FileStream* FX_CreateFileStream(const FX_CHAR* filename, FX_DWORD dwModes); |
| 135 IFX_FileStream* FX_CreateFileStream(const FX_WCHAR* filename, FX_DWORD dwModes); | 137 IFX_FileStream* FX_CreateFileStream(const FX_WCHAR* filename, FX_DWORD dwModes); |
| 138 #ifdef PDF_ENABLE_XFA | |
| 139 class IFX_FileAccess { | |
| 140 public: | |
| 141 virtual ~IFX_FileAccess() {} | |
| 142 virtual void Release() = 0; | |
| 143 virtual IFX_FileAccess* Retain() = 0; | |
| 144 virtual void GetPath(CFX_WideString& wsPath) = 0; | |
| 145 virtual IFX_FileStream* CreateFileStream(FX_DWORD dwModes) = 0; | |
| 146 }; | |
| 147 IFX_FileAccess* FX_CreateDefaultFileAccess(const CFX_WideStringC& wsPath); | |
| 148 #endif | |
| 136 class IFX_MemoryStream : public IFX_FileStream { | 149 class IFX_MemoryStream : public IFX_FileStream { |
| 137 public: | 150 public: |
| 138 virtual FX_BOOL IsConsecutive() const = 0; | 151 virtual FX_BOOL IsConsecutive() const = 0; |
| 139 | 152 |
| 140 virtual void EstimateSize(size_t nInitSize, size_t nGrowSize) = 0; | 153 virtual void EstimateSize(size_t nInitSize, size_t nGrowSize) = 0; |
| 141 | 154 |
| 142 virtual uint8_t* GetBuffer() const = 0; | 155 virtual uint8_t* GetBuffer() const = 0; |
| 143 | 156 |
| 144 virtual void AttachBuffer(uint8_t* pBuffer, | 157 virtual void AttachBuffer(uint8_t* pBuffer, |
| 145 size_t nSize, | 158 size_t nSize, |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 164 virtual FX_BOOL ReadNextBlock(FX_BOOL bRestart = FALSE) = 0; | 177 virtual FX_BOOL ReadNextBlock(FX_BOOL bRestart = FALSE) = 0; |
| 165 | 178 |
| 166 virtual const uint8_t* GetBlockBuffer() = 0; | 179 virtual const uint8_t* GetBlockBuffer() = 0; |
| 167 | 180 |
| 168 virtual size_t GetBlockSize() = 0; | 181 virtual size_t GetBlockSize() = 0; |
| 169 | 182 |
| 170 virtual FX_FILESIZE GetBlockOffset() = 0; | 183 virtual FX_FILESIZE GetBlockOffset() = 0; |
| 171 }; | 184 }; |
| 172 | 185 |
| 173 #endif // CORE_INCLUDE_FXCRT_FX_STREAM_H_ | 186 #endif // CORE_INCLUDE_FXCRT_FX_STREAM_H_ |
| OLD | NEW |