| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef CORE_FPDFAPI_PARSER_CPDF_LINEARIZED_H_ | 7 #ifndef CORE_FPDFAPI_PARSER_CPDF_LINEARIZED_HEADER_H_ |
| 8 #define CORE_FPDFAPI_PARSER_CPDF_LINEARIZED_H_ | 8 #define CORE_FPDFAPI_PARSER_CPDF_LINEARIZED_HEADER_H_ |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "core/fxcrt/fx_memory.h" | 12 #include "core/fxcrt/fx_memory.h" |
| 13 #include "core/fxcrt/fx_stream.h" | 13 #include "core/fxcrt/fx_stream.h" |
| 14 | 14 |
| 15 class CPDF_Dictionary; | 15 class CPDF_Dictionary; |
| 16 class CPDF_Object; | 16 class CPDF_Object; |
| 17 | 17 |
| 18 class CPDF_Linearized { | 18 class CPDF_LinearizedHeader { |
| 19 public: | 19 public: |
| 20 ~CPDF_Linearized(); | 20 ~CPDF_LinearizedHeader(); |
| 21 static std::unique_ptr<CPDF_Linearized> CreateForObject( | 21 static std::unique_ptr<CPDF_LinearizedHeader> CreateForObject( |
| 22 std::unique_ptr<CPDF_Object> pObj); | 22 std::unique_ptr<CPDF_Object> pObj); |
| 23 | 23 |
| 24 // Will only return values > 0. | 24 // Will only return values > 0. |
| 25 FX_FILESIZE GetFileSize() const { return m_szFileSize; } | 25 FX_FILESIZE GetFileSize() const { return m_szFileSize; } |
| 26 uint32_t GetFirstPageNo() const { return m_dwFirstPageNo; } | 26 uint32_t GetFirstPageNo() const { return m_dwFirstPageNo; } |
| 27 // Will only return values > 0. | 27 // Will only return values > 0. |
| 28 FX_FILESIZE GetLastXRefOffset() const { return m_szLastXRefOffset; } | 28 FX_FILESIZE GetLastXRefOffset() const { return m_szLastXRefOffset; } |
| 29 uint32_t GetPageCount() const { return m_PageCount; } | 29 uint32_t GetPageCount() const { return m_PageCount; } |
| 30 // Will only return values > 0. | 30 // Will only return values > 0. |
| 31 FX_FILESIZE GetFirstPageEndOffset() const { return m_szFirstPageEndOffset; } | 31 FX_FILESIZE GetFirstPageEndOffset() const { return m_szFirstPageEndOffset; } |
| 32 // Will only return values > 0. | 32 // Will only return values > 0. |
| 33 uint32_t GetFirstPageObjNum() const { return m_FirstPageObjNum; } | 33 uint32_t GetFirstPageObjNum() const { return m_FirstPageObjNum; } |
| 34 | 34 |
| 35 bool HasHintTable() const; | 35 bool HasHintTable() const; |
| 36 // Will only return values > 0. | 36 // Will only return values > 0. |
| 37 FX_FILESIZE GetHintStart() const { return m_szHintStart; } | 37 FX_FILESIZE GetHintStart() const { return m_szHintStart; } |
| 38 // Will only return values > 0. | 38 // Will only return values > 0. |
| 39 FX_FILESIZE GetHintLength() const { return m_szHintLength; } | 39 FX_FILESIZE GetHintLength() const { return m_szHintLength; } |
| 40 | 40 |
| 41 protected: | 41 protected: |
| 42 explicit CPDF_Linearized(const CPDF_Dictionary* pDict); | 42 explicit CPDF_LinearizedHeader(const CPDF_Dictionary* pDict); |
| 43 | 43 |
| 44 private: | 44 private: |
| 45 FX_FILESIZE m_szFileSize = 0; | 45 FX_FILESIZE m_szFileSize = 0; |
| 46 uint32_t m_dwFirstPageNo = 0; | 46 uint32_t m_dwFirstPageNo = 0; |
| 47 FX_FILESIZE m_szLastXRefOffset = 0; | 47 FX_FILESIZE m_szLastXRefOffset = 0; |
| 48 uint32_t m_PageCount = 0; | 48 uint32_t m_PageCount = 0; |
| 49 FX_FILESIZE m_szFirstPageEndOffset = 0; | 49 FX_FILESIZE m_szFirstPageEndOffset = 0; |
| 50 uint32_t m_FirstPageObjNum = 0; | 50 uint32_t m_FirstPageObjNum = 0; |
| 51 FX_FILESIZE m_szHintStart = 0; | 51 FX_FILESIZE m_szHintStart = 0; |
| 52 FX_FILESIZE m_szHintLength = 0; | 52 FX_FILESIZE m_szHintLength = 0; |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 #endif // CORE_FPDFAPI_PARSER_CPDF_LINEARIZED_H_ | 55 #endif // CORE_FPDFAPI_PARSER_CPDF_LINEARIZED_HEADER_H_ |
| OLD | NEW |