summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_parser/include/cpdf_stream_acc.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2016-03-15 14:57:22 -0400
committerDan Sinclair <dsinclair@chromium.org>2016-03-15 14:57:22 -0400
commitaa403d3f68a966e24a6d8e8c109970930f096afb (patch)
treefeee638c1d8cee4b191bf09c2637009bb9cd6f30 /core/fpdfapi/fpdf_parser/include/cpdf_stream_acc.h
parente40764862208b8cb76f507c489b01e3795fd93bd (diff)
downloadpdfium-aa403d3f68a966e24a6d8e8c109970930f096afb.tar.xz
core/include/fdpfapi cleanup Part I.
This Cl moves a bunch of the files from core/include/fpdfapi to their correct location outside the core/include tree. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1805603002 .
Diffstat (limited to 'core/fpdfapi/fpdf_parser/include/cpdf_stream_acc.h')
-rw-r--r--core/fpdfapi/fpdf_parser/include/cpdf_stream_acc.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_stream_acc.h b/core/fpdfapi/fpdf_parser/include/cpdf_stream_acc.h
new file mode 100644
index 0000000000..6920579c8e
--- /dev/null
+++ b/core/fpdfapi/fpdf_parser/include/cpdf_stream_acc.h
@@ -0,0 +1,46 @@
+// Copyright 2016 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_FPDF_PARSER_INCLUDE_CPDF_STREAM_ACC_H_
+#define CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_STREAM_ACC_H_
+
+#include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h"
+#include "core/fpdfapi/fpdf_parser/include/cpdf_stream.h"
+#include "core/include/fxcrt/fx_string.h"
+#include "core/include/fxcrt/fx_system.h"
+
+class CPDF_StreamAcc {
+ public:
+ CPDF_StreamAcc();
+ ~CPDF_StreamAcc();
+
+ void LoadAllData(const CPDF_Stream* pStream,
+ FX_BOOL bRawAccess = FALSE,
+ FX_DWORD estimated_size = 0,
+ FX_BOOL bImageAcc = FALSE);
+
+ const CPDF_Stream* GetStream() const { return m_pStream; }
+ CPDF_Dictionary* GetDict() const {
+ return m_pStream ? m_pStream->GetDict() : nullptr;
+ }
+
+ const uint8_t* GetData() const;
+ FX_DWORD GetSize() const;
+ const CFX_ByteString& GetImageDecoder() const { return m_ImageDecoder; }
+ const CPDF_Dictionary* GetImageParam() const { return m_pImageParam; }
+ uint8_t* DetachData();
+
+ protected:
+ uint8_t* m_pData;
+ FX_DWORD m_dwSize;
+ FX_BOOL m_bNewBuf;
+ CFX_ByteString m_ImageDecoder;
+ CPDF_Dictionary* m_pImageParam;
+ const CPDF_Stream* m_pStream;
+ uint8_t* m_pSrcData;
+};
+
+#endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_STREAM_ACC_H_