Dan Sinclair | a0b1954 | 2017-05-09 12:36:08 -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 CORE_FPDFAPI_EDIT_CPDF_FLATEENCODER_H_ |
| 8 | #define CORE_FPDFAPI_EDIT_CPDF_FLATEENCODER_H_ |
| 9 | |
| 10 | #include "core/fpdfapi/parser/cpdf_dictionary.h" |
| 11 | #include "core/fpdfapi/parser/cpdf_stream_acc.h" |
Dan Sinclair | a0b1954 | 2017-05-09 12:36:08 -0400 | [diff] [blame] | 12 | #include "core/fxcrt/cfx_retain_ptr.h" |
| 13 | #include "core/fxcrt/fx_memory.h" |
Dan Sinclair | de44d15 | 2017-09-21 14:52:41 -0400 | [diff] [blame^] | 14 | #include "core/fxcrt/maybe_owned.h" |
Dan Sinclair | a0b1954 | 2017-05-09 12:36:08 -0400 | [diff] [blame] | 15 | |
| 16 | class CPDF_Stream; |
| 17 | |
| 18 | class CPDF_FlateEncoder { |
| 19 | public: |
| 20 | CPDF_FlateEncoder(CPDF_Stream* pStream, bool bFlateEncode); |
Dan Sinclair | a0b1954 | 2017-05-09 12:36:08 -0400 | [diff] [blame] | 21 | ~CPDF_FlateEncoder(); |
| 22 | |
| 23 | void CloneDict(); |
| 24 | |
| 25 | uint32_t GetSize() const { return m_dwSize; } |
| 26 | uint8_t* GetData() const { return m_pData.Get(); } |
| 27 | |
| 28 | CPDF_Dictionary* GetDict() { return m_pDict.Get(); } |
| 29 | |
| 30 | private: |
| 31 | uint32_t m_dwSize; |
Dan Sinclair | de44d15 | 2017-09-21 14:52:41 -0400 | [diff] [blame^] | 32 | MaybeOwned<uint8_t, FxFreeDeleter> m_pData; |
| 33 | MaybeOwned<CPDF_Dictionary> m_pDict; |
Dan Sinclair | a0b1954 | 2017-05-09 12:36:08 -0400 | [diff] [blame] | 34 | CFX_RetainPtr<CPDF_StreamAcc> m_pAcc; |
| 35 | }; |
| 36 | |
| 37 | #endif // CORE_FPDFAPI_EDIT_CPDF_FLATEENCODER_H_ |