Dan Sinclair | ae4656e | 2017-05-09 12:36:41 -0400 | [diff] [blame] | 1 | // Copyright 2017 PDFium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | |
| 7 | #ifndef FPDFSDK_FSDK_FILEWRITEADAPTER_H_ |
| 8 | #define FPDFSDK_FSDK_FILEWRITEADAPTER_H_ |
| 9 | |
| 10 | #include "core/fxcrt/cfx_retain_ptr.h" |
| 11 | #include "core/fxcrt/fx_stream.h" |
| 12 | #include "public/fpdf_save.h" |
| 13 | |
| 14 | class FSDK_FileWriteAdapter : public IFX_WriteStream { |
| 15 | public: |
| 16 | template <typename T, typename... Args> |
| 17 | friend CFX_RetainPtr<T> pdfium::MakeRetain(Args&&... args); |
| 18 | |
| 19 | bool WriteBlock(const void* data, size_t size) override; |
dan sinclair | 017ebba | 2017-05-12 09:18:06 -0400 | [diff] [blame] | 20 | bool WriteString(const CFX_ByteStringC& str) override; |
Dan Sinclair | ae4656e | 2017-05-09 12:36:41 -0400 | [diff] [blame] | 21 | |
| 22 | private: |
| 23 | explicit FSDK_FileWriteAdapter(FPDF_FILEWRITE* fileWriteStruct); |
| 24 | ~FSDK_FileWriteAdapter() override; |
| 25 | |
| 26 | FPDF_FILEWRITE* fileWriteStruct_; |
| 27 | }; |
| 28 | |
| 29 | #endif // FPDFSDK_FSDK_FILEWRITEADAPTER_H_ |