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_PARSER_H_ | 7 #ifndef CORE_FPDFAPI_PARSER_CPDF_PARSER_H_ |
8 #define CORE_FPDFAPI_PARSER_CPDF_PARSER_H_ | 8 #define CORE_FPDFAPI_PARSER_CPDF_PARSER_H_ |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 CPDF_Dictionary* GetTrailer() const { return m_pTrailer; } | 52 CPDF_Dictionary* GetTrailer() const { return m_pTrailer; } |
53 FX_FILESIZE GetLastXRefOffset() const { return m_LastXRefOffset; } | 53 FX_FILESIZE GetLastXRefOffset() const { return m_LastXRefOffset; } |
54 | 54 |
55 uint32_t GetPermissions() const; | 55 uint32_t GetPermissions() const; |
56 uint32_t GetRootObjNum(); | 56 uint32_t GetRootObjNum(); |
57 uint32_t GetInfoObjNum(); | 57 uint32_t GetInfoObjNum(); |
58 CPDF_Array* GetIDArray(); | 58 CPDF_Array* GetIDArray(); |
59 | 59 |
60 CPDF_Dictionary* GetEncryptDict() const { return m_pEncryptDict; } | 60 CPDF_Dictionary* GetEncryptDict() const { return m_pEncryptDict; } |
61 | 61 |
62 CPDF_Object* ParseIndirectObject(CPDF_IndirectObjectHolder* pObjList, | 62 std::unique_ptr<CPDF_Object> ParseIndirectObject( |
63 uint32_t objnum); | 63 CPDF_IndirectObjectHolder* pObjList, |
| 64 uint32_t objnum); |
64 | 65 |
65 uint32_t GetLastObjNum() const; | 66 uint32_t GetLastObjNum() const; |
66 bool IsValidObjectNumber(uint32_t objnum) const; | 67 bool IsValidObjectNumber(uint32_t objnum) const; |
67 FX_FILESIZE GetObjectPositionOrZero(uint32_t objnum) const; | 68 FX_FILESIZE GetObjectPositionOrZero(uint32_t objnum) const; |
68 uint8_t GetObjectType(uint32_t objnum) const; | 69 uint8_t GetObjectType(uint32_t objnum) const; |
69 uint16_t GetObjectGenNum(uint32_t objnum) const; | 70 uint16_t GetObjectGenNum(uint32_t objnum) const; |
70 bool IsVersionUpdated() const { return m_bVersionUpdated; } | 71 bool IsVersionUpdated() const { return m_bVersionUpdated; } |
71 bool IsObjectFreeOrNull(uint32_t objnum) const; | 72 bool IsObjectFreeOrNull(uint32_t objnum) const; |
72 CPDF_CryptoHandler* GetCryptoHandler(); | 73 CPDF_CryptoHandler* GetCryptoHandler(); |
73 IFX_SeekableReadStream* GetFileAccess() const; | 74 IFX_SeekableReadStream* GetFileAccess() const; |
74 | 75 |
75 FX_FILESIZE GetObjectOffset(uint32_t objnum) const; | 76 FX_FILESIZE GetObjectOffset(uint32_t objnum) const; |
76 FX_FILESIZE GetObjectSize(uint32_t objnum) const; | 77 FX_FILESIZE GetObjectSize(uint32_t objnum) const; |
77 | 78 |
78 void GetIndirectBinary(uint32_t objnum, uint8_t*& pBuffer, uint32_t& size); | 79 void GetIndirectBinary(uint32_t objnum, uint8_t*& pBuffer, uint32_t& size); |
79 int GetFileVersion() const { return m_FileVersion; } | 80 int GetFileVersion() const { return m_FileVersion; } |
80 bool IsXRefStream() const { return m_bXRefStream; } | 81 bool IsXRefStream() const { return m_bXRefStream; } |
81 | 82 |
82 CPDF_Object* ParseIndirectObjectAt(CPDF_IndirectObjectHolder* pObjList, | 83 std::unique_ptr<CPDF_Object> ParseIndirectObjectAt( |
83 FX_FILESIZE pos, | 84 CPDF_IndirectObjectHolder* pObjList, |
84 uint32_t objnum); | 85 FX_FILESIZE pos, |
| 86 uint32_t objnum); |
85 | 87 |
86 CPDF_Object* ParseIndirectObjectAtByStrict( | 88 std::unique_ptr<CPDF_Object> ParseIndirectObjectAtByStrict( |
87 CPDF_IndirectObjectHolder* pObjList, | 89 CPDF_IndirectObjectHolder* pObjList, |
88 FX_FILESIZE pos, | 90 FX_FILESIZE pos, |
89 uint32_t objnum, | 91 uint32_t objnum, |
90 FX_FILESIZE* pResultPos); | 92 FX_FILESIZE* pResultPos); |
91 | 93 |
92 uint32_t GetFirstPageNo() const; | 94 uint32_t GetFirstPageNo() const; |
93 | 95 |
94 protected: | 96 protected: |
95 struct ObjectInfo { | 97 struct ObjectInfo { |
96 ObjectInfo() : pos(0), type(0), gennum(0) {} | 98 ObjectInfo() : pos(0), type(0), gennum(0) {} |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 | 172 |
171 // Mapping of streams to their object caches. This is valid as long as the | 173 // Mapping of streams to their object caches. This is valid as long as the |
172 // streams in |m_ObjectStreamMap| are valid. | 174 // streams in |m_ObjectStreamMap| are valid. |
173 std::map<CPDF_StreamAcc*, StreamObjectCache> m_ObjCache; | 175 std::map<CPDF_StreamAcc*, StreamObjectCache> m_ObjCache; |
174 | 176 |
175 // All indirect object numbers that are being parsed. | 177 // All indirect object numbers that are being parsed. |
176 std::set<uint32_t> m_ParsingObjNums; | 178 std::set<uint32_t> m_ParsingObjNums; |
177 }; | 179 }; |
178 | 180 |
179 #endif // CORE_FPDFAPI_PARSER_CPDF_PARSER_H_ | 181 #endif // CORE_FPDFAPI_PARSER_CPDF_PARSER_H_ |
OLD | NEW |