Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1084)

Unified Diff: core/fpdfapi/parser/cpdf_linearized.h

Issue 2466023002: Unify some code (Closed)
Patch Set: Rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfapi/parser/cpdf_hint_tables.cpp ('k') | core/fpdfapi/parser/cpdf_linearized.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/parser/cpdf_linearized.h
diff --git a/core/fpdfapi/parser/cpdf_linearized.h b/core/fpdfapi/parser/cpdf_linearized.h
new file mode 100644
index 0000000000000000000000000000000000000000..caf538e3feeb42df994083bd5146dc73ec5ded5c
--- /dev/null
+++ b/core/fpdfapi/parser/cpdf_linearized.h
@@ -0,0 +1,55 @@
+// 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_PARSER_CPDF_LINEARIZED_H_
+#define CORE_FPDFAPI_PARSER_CPDF_LINEARIZED_H_
+
+#include <memory>
+
+#include "core/fxcrt/fx_memory.h"
+#include "core/fxcrt/fx_stream.h"
+
+class CPDF_Dictionary;
+class CPDF_Object;
+
+class CPDF_Linearized {
+ public:
+ ~CPDF_Linearized();
+ static std::unique_ptr<CPDF_Linearized> CreateForObject(
+ std::unique_ptr<CPDF_Object> pObj);
+
+ // Will only return values > 0.
+ FX_FILESIZE GetFileSize() const { return m_szFileSize; }
+ uint32_t GetFirstPageNo() const { return m_dwFirstPageNo; }
+ // Will only return values > 0.
+ FX_FILESIZE GetLastXRefOffset() const { return m_szLastXRefOffset; }
+ uint32_t GetPageCount() const { return m_PageCount; }
+ // Will only return values > 0.
+ FX_FILESIZE GetFirstPageEndOffset() const { return m_szFirstPageEndOffset; }
+ // Will only return values > 0.
+ uint32_t GetFirstPageObjNum() const { return m_FirstPageObjNum; }
+
+ bool HasHintTable() const;
+ // Will only return values > 0.
+ FX_FILESIZE GetHintStart() const { return m_szHintStart; }
+ // Will only return values > 0.
+ FX_FILESIZE GetHintLength() const { return m_szHintLength; }
+
+ protected:
+ explicit CPDF_Linearized(const CPDF_Dictionary* pDict);
+
+ private:
+ FX_FILESIZE m_szFileSize = 0;
+ uint32_t m_dwFirstPageNo = 0;
+ FX_FILESIZE m_szLastXRefOffset = 0;
+ uint32_t m_PageCount = 0;
+ FX_FILESIZE m_szFirstPageEndOffset = 0;
+ uint32_t m_FirstPageObjNum = 0;
+ FX_FILESIZE m_szHintStart = 0;
+ FX_FILESIZE m_szHintLength = 0;
+};
+
+#endif // CORE_FPDFAPI_PARSER_CPDF_LINEARIZED_H_
« no previous file with comments | « core/fpdfapi/parser/cpdf_hint_tables.cpp ('k') | core/fpdfapi/parser/cpdf_linearized.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698