summaryrefslogtreecommitdiff
path: root/core/fpdfapi/edit/cpdf_flateencoder.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-05-09 12:36:08 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-05-09 17:48:44 +0000
commita0b1954794b7a8a279ba00787628cc7f8d1419d9 (patch)
tree4556b78b9550dbb80baa52e0eee016395f223c4e /core/fpdfapi/edit/cpdf_flateencoder.h
parente02b2bc896b0872ce1a9d0997946b07dc76b9f7b (diff)
downloadpdfium-a0b1954794b7a8a279ba00787628cc7f8d1419d9.tar.xz
Rename fpdf_edit_create.cpp to cpdf_creator.cpp
This Cl renames the fpdf_edit_create file to better match the cpdf_creator content. The CPDF_ObjectStream and CPDF_XRefStream code is moved out to their own .cpp files. Needed anonymous classes are split out as well. Change-Id: Ic83fb319ce28c816db82a4286e22032dc68811bc Reviewed-on: https://pdfium-review.googlesource.com/5171 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'core/fpdfapi/edit/cpdf_flateencoder.h')
-rw-r--r--core/fpdfapi/edit/cpdf_flateencoder.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/core/fpdfapi/edit/cpdf_flateencoder.h b/core/fpdfapi/edit/cpdf_flateencoder.h
new file mode 100644
index 0000000000..ac850e2802
--- /dev/null
+++ b/core/fpdfapi/edit/cpdf_flateencoder.h
@@ -0,0 +1,41 @@
+// Copyright 2017 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef CORE_FPDFAPI_EDIT_CPDF_FLATEENCODER_H_
+#define CORE_FPDFAPI_EDIT_CPDF_FLATEENCODER_H_
+
+#include "core/fpdfapi/parser/cpdf_dictionary.h"
+#include "core/fpdfapi/parser/cpdf_stream_acc.h"
+#include "core/fxcrt/cfx_maybe_owned.h"
+#include "core/fxcrt/cfx_retain_ptr.h"
+#include "core/fxcrt/fx_memory.h"
+
+class CPDF_Stream;
+
+class CPDF_FlateEncoder {
+ public:
+ CPDF_FlateEncoder(CPDF_Stream* pStream, bool bFlateEncode);
+ CPDF_FlateEncoder(const uint8_t* pBuffer,
+ uint32_t size,
+ bool bFlateEncode,
+ bool bXRefStream);
+ ~CPDF_FlateEncoder();
+
+ void CloneDict();
+
+ uint32_t GetSize() const { return m_dwSize; }
+ uint8_t* GetData() const { return m_pData.Get(); }
+
+ CPDF_Dictionary* GetDict() { return m_pDict.Get(); }
+
+ private:
+ uint32_t m_dwSize;
+ CFX_MaybeOwned<uint8_t, FxFreeDeleter> m_pData;
+ CFX_MaybeOwned<CPDF_Dictionary> m_pDict;
+ CFX_RetainPtr<CPDF_StreamAcc> m_pAcc;
+};
+
+#endif // CORE_FPDFAPI_EDIT_CPDF_FLATEENCODER_H_