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_INCLUDE_FPDFAPI_CPDF_PARSER_H_ | 7 #ifndef CORE_INCLUDE_FPDFAPI_CPDF_PARSER_H_ |
8 #define CORE_INCLUDE_FPDFAPI_CPDF_PARSER_H_ | 8 #define CORE_INCLUDE_FPDFAPI_CPDF_PARSER_H_ |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <memory> | 11 #include <memory> |
12 #include <set> | 12 #include <set> |
13 | 13 |
14 #include "core/include/fxcrt/fx_basic.h" | 14 #include "core/include/fxcrt/fx_basic.h" |
15 | 15 |
16 class CPDF_Array; | 16 class CPDF_Array; |
17 class CPDF_CryptoHandler; | |
18 class CPDF_Dictionary; | 17 class CPDF_Dictionary; |
19 class CPDF_Document; | 18 class CPDF_Document; |
20 class CPDF_IndirectObjectHolder; | 19 class CPDF_IndirectObjectHolder; |
21 class CPDF_Object; | 20 class CPDF_Object; |
22 class CPDF_StreamAcc; | 21 class CPDF_StreamAcc; |
23 class CPDF_SyntaxParser; | 22 class CPDF_SyntaxParser; |
24 class IFX_FileRead; | 23 class IFX_FileRead; |
| 24 class IPDF_CryptoHandler; |
25 class IPDF_SecurityHandler; | 25 class IPDF_SecurityHandler; |
26 | 26 |
27 class CPDF_Parser { | 27 class CPDF_Parser { |
28 public: | 28 public: |
29 enum Error { | 29 enum Error { |
30 SUCCESS = 0, | 30 SUCCESS = 0, |
31 FILE_ERROR, | 31 FILE_ERROR, |
32 FORMAT_ERROR, | 32 FORMAT_ERROR, |
33 PASSWORD_ERROR, | 33 PASSWORD_ERROR, |
34 HANDLER_ERROR | 34 HANDLER_ERROR |
(...skipping 21 matching lines...) Expand all Loading... |
56 FX_DWORD objnum); | 56 FX_DWORD objnum); |
57 | 57 |
58 FX_DWORD GetLastObjNum() const; | 58 FX_DWORD GetLastObjNum() const; |
59 bool IsValidObjectNumber(FX_DWORD objnum) const; | 59 bool IsValidObjectNumber(FX_DWORD objnum) const; |
60 FX_FILESIZE GetObjectPositionOrZero(FX_DWORD objnum) const; | 60 FX_FILESIZE GetObjectPositionOrZero(FX_DWORD objnum) const; |
61 uint8_t GetObjectType(FX_DWORD objnum) const; | 61 uint8_t GetObjectType(FX_DWORD objnum) const; |
62 uint16_t GetObjectGenNum(FX_DWORD objnum) const; | 62 uint16_t GetObjectGenNum(FX_DWORD objnum) const; |
63 bool IsVersionUpdated() const { return m_bVersionUpdated; } | 63 bool IsVersionUpdated() const { return m_bVersionUpdated; } |
64 bool IsObjectFreeOrNull(FX_DWORD objnum) const; | 64 bool IsObjectFreeOrNull(FX_DWORD objnum) const; |
65 FX_BOOL IsFormStream(FX_DWORD objnum, FX_BOOL& bForm); | 65 FX_BOOL IsFormStream(FX_DWORD objnum, FX_BOOL& bForm); |
66 CPDF_CryptoHandler* GetCryptoHandler(); | 66 IPDF_CryptoHandler* GetCryptoHandler(); |
67 IFX_FileRead* GetFileAccess() const; | 67 IFX_FileRead* GetFileAccess() const; |
68 | 68 |
69 FX_FILESIZE GetObjectOffset(FX_DWORD objnum) const; | 69 FX_FILESIZE GetObjectOffset(FX_DWORD objnum) const; |
70 FX_FILESIZE GetObjectSize(FX_DWORD objnum) const; | 70 FX_FILESIZE GetObjectSize(FX_DWORD objnum) const; |
71 | 71 |
72 void GetIndirectBinary(FX_DWORD objnum, uint8_t*& pBuffer, FX_DWORD& size); | 72 void GetIndirectBinary(FX_DWORD objnum, uint8_t*& pBuffer, FX_DWORD& size); |
73 int GetFileVersion() const { return m_FileVersion; } | 73 int GetFileVersion() const { return m_FileVersion; } |
74 FX_BOOL IsXRefStream() const { return m_bXRefStream; } | 74 FX_BOOL IsXRefStream() const { return m_bXRefStream; } |
75 | 75 |
76 CPDF_Object* ParseIndirectObjectAt(CPDF_IndirectObjectHolder* pObjList, | 76 CPDF_Object* ParseIndirectObjectAt(CPDF_IndirectObjectHolder* pObjList, |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 kPostObjNum, | 164 kPostObjNum, |
165 kGenNum, | 165 kGenNum, |
166 kPostGenNum, | 166 kPostGenNum, |
167 kTrailer, | 167 kTrailer, |
168 kBeginObj, | 168 kBeginObj, |
169 kEndObj | 169 kEndObj |
170 }; | 170 }; |
171 }; | 171 }; |
172 | 172 |
173 #endif // CORE_INCLUDE_FPDFAPI_CPDF_PARSER_H_ | 173 #endif // CORE_INCLUDE_FPDFAPI_CPDF_PARSER_H_ |
OLD | NEW |