blob: 3698414fd2a692851cc8f03374b6332f1b9bbf23 [file] [log] [blame]
Dan Sinclaira0b19542017-05-09 12:36:08 -04001// 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 Sinclaira0b19542017-05-09 12:36:08 -040012#include "core/fxcrt/cfx_retain_ptr.h"
13#include "core/fxcrt/fx_memory.h"
Dan Sinclairde44d152017-09-21 14:52:41 -040014#include "core/fxcrt/maybe_owned.h"
Dan Sinclaira0b19542017-05-09 12:36:08 -040015
16class CPDF_Stream;
17
18class CPDF_FlateEncoder {
19 public:
20 CPDF_FlateEncoder(CPDF_Stream* pStream, bool bFlateEncode);
Dan Sinclaira0b19542017-05-09 12:36:08 -040021 ~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 Sinclairde44d152017-09-21 14:52:41 -040032 MaybeOwned<uint8_t, FxFreeDeleter> m_pData;
33 MaybeOwned<CPDF_Dictionary> m_pDict;
Dan Sinclaira0b19542017-05-09 12:36:08 -040034 CFX_RetainPtr<CPDF_StreamAcc> m_pAcc;
35};
36
37#endif // CORE_FPDFAPI_EDIT_CPDF_FLATEENCODER_H_