| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 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_FPDF_PARSER_H_ | 7 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ |
| 8 #define CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ | 8 #define CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 CPDF_IndirectObjectHolder* pObjList, | 389 CPDF_IndirectObjectHolder* pObjList, |
| 390 FX_FILESIZE pos, | 390 FX_FILESIZE pos, |
| 391 FX_DWORD objnum, | 391 FX_DWORD objnum, |
| 392 FX_FILESIZE* pResultPos); | 392 FX_FILESIZE* pResultPos); |
| 393 | 393 |
| 394 Error StartAsyncParse(IFX_FileRead* pFile); | 394 Error StartAsyncParse(IFX_FileRead* pFile); |
| 395 | 395 |
| 396 FX_DWORD GetFirstPageNo() const { return m_dwFirstPageNo; } | 396 FX_DWORD GetFirstPageNo() const { return m_dwFirstPageNo; } |
| 397 | 397 |
| 398 protected: | 398 protected: |
| 399 struct ObjectInfo { |
| 400 ObjectInfo() : pos(0), type(0), gennum(0) {} |
| 401 |
| 402 FX_FILESIZE pos; |
| 403 uint8_t type; |
| 404 uint16_t gennum; |
| 405 }; |
| 406 |
| 399 void CloseParser(); | 407 void CloseParser(); |
| 400 CPDF_Object* ParseDirect(CPDF_Object* pObj); | 408 CPDF_Object* ParseDirect(CPDF_Object* pObj); |
| 401 FX_BOOL LoadAllCrossRefV4(FX_FILESIZE pos); | 409 FX_BOOL LoadAllCrossRefV4(FX_FILESIZE pos); |
| 402 FX_BOOL LoadAllCrossRefV5(FX_FILESIZE pos); | 410 FX_BOOL LoadAllCrossRefV5(FX_FILESIZE pos); |
| 403 bool LoadCrossRefV4(FX_FILESIZE pos, FX_FILESIZE streampos, FX_BOOL bSkip); | 411 bool LoadCrossRefV4(FX_FILESIZE pos, FX_FILESIZE streampos, FX_BOOL bSkip); |
| 404 FX_BOOL LoadCrossRefV5(FX_FILESIZE* pos, FX_BOOL bMainXRef); | 412 FX_BOOL LoadCrossRefV5(FX_FILESIZE* pos, FX_BOOL bMainXRef); |
| 405 CPDF_Dictionary* LoadTrailerV4(); | 413 CPDF_Dictionary* LoadTrailerV4(); |
| 406 FX_BOOL RebuildCrossRef(); | 414 FX_BOOL RebuildCrossRef(); |
| 407 Error SetEncryptHandler(); | 415 Error SetEncryptHandler(); |
| 408 void ReleaseEncryptHandler(); | 416 void ReleaseEncryptHandler(); |
| 409 FX_BOOL LoadLinearizedAllCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount); | 417 FX_BOOL LoadLinearizedAllCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount); |
| 410 FX_BOOL LoadLinearizedCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount); | 418 FX_BOOL LoadLinearizedCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount); |
| 411 FX_BOOL LoadLinearizedAllCrossRefV5(FX_FILESIZE pos); | 419 FX_BOOL LoadLinearizedAllCrossRefV5(FX_FILESIZE pos); |
| 412 Error LoadLinearizedMainXRefTable(); | 420 Error LoadLinearizedMainXRefTable(); |
| 413 CPDF_StreamAcc* GetObjectStream(FX_DWORD number); | 421 CPDF_StreamAcc* GetObjectStream(FX_DWORD number); |
| 414 FX_BOOL IsLinearizedFile(IFX_FileRead* pFileAccess, FX_DWORD offset); | 422 FX_BOOL IsLinearizedFile(IFX_FileRead* pFileAccess, FX_DWORD offset); |
| 415 bool FindPosInOffsets(FX_FILESIZE pos) const; | |
| 416 void SetEncryptDictionary(CPDF_Dictionary* pDict); | 423 void SetEncryptDictionary(CPDF_Dictionary* pDict); |
| 417 void ShrinkObjectMap(FX_DWORD size); | 424 void ShrinkObjectMap(FX_DWORD size); |
| 418 | 425 |
| 419 CPDF_Document* m_pDocument; | 426 CPDF_Document* m_pDocument; |
| 420 CPDF_SyntaxParser m_Syntax; | 427 CPDF_SyntaxParser m_Syntax; |
| 421 bool m_bOwnFileRead; | 428 bool m_bOwnFileRead; |
| 422 int m_FileVersion; | 429 int m_FileVersion; |
| 423 CPDF_Dictionary* m_pTrailer; | 430 CPDF_Dictionary* m_pTrailer; |
| 424 CPDF_Dictionary* m_pEncryptDict; | 431 CPDF_Dictionary* m_pEncryptDict; |
| 425 FX_FILESIZE m_LastXRefOffset; | 432 FX_FILESIZE m_LastXRefOffset; |
| 426 FX_BOOL m_bXRefStream; | 433 FX_BOOL m_bXRefStream; |
| 427 std::unique_ptr<IPDF_SecurityHandler> m_pSecurityHandler; | 434 std::unique_ptr<IPDF_SecurityHandler> m_pSecurityHandler; |
| 428 CFX_ByteString m_bsRecipient; | 435 CFX_ByteString m_bsRecipient; |
| 429 CFX_ByteString m_FilePath; | 436 CFX_ByteString m_FilePath; |
| 430 CFX_ByteString m_Password; | 437 CFX_ByteString m_Password; |
| 431 | |
| 432 struct ObjectInfo { | |
| 433 ObjectInfo() : pos(0), type(0), gennum(0) {} | |
| 434 | |
| 435 FX_FILESIZE pos; | |
| 436 uint8_t type; | |
| 437 uint16_t gennum; | |
| 438 }; | |
| 439 std::map<FX_DWORD, ObjectInfo> m_ObjectInfo; | 438 std::map<FX_DWORD, ObjectInfo> m_ObjectInfo; |
| 440 | 439 std::set<FX_FILESIZE> m_SortedOffset; |
| 441 CFX_FileSizeArray m_SortedOffset; | |
| 442 CFX_ArrayTemplate<CPDF_Dictionary*> m_Trailers; | 440 CFX_ArrayTemplate<CPDF_Dictionary*> m_Trailers; |
| 443 FX_BOOL m_bVersionUpdated; | 441 FX_BOOL m_bVersionUpdated; |
| 444 CPDF_Object* m_pLinearized; | 442 CPDF_Object* m_pLinearized; |
| 445 FX_DWORD m_dwFirstPageNo; | 443 FX_DWORD m_dwFirstPageNo; |
| 446 FX_DWORD m_dwXrefStartObjNum; | 444 FX_DWORD m_dwXrefStartObjNum; |
| 447 | 445 |
| 448 // A map of object numbers to indirect streams. Map owns the streams. | 446 // A map of object numbers to indirect streams. Map owns the streams. |
| 449 std::map<FX_DWORD, std::unique_ptr<CPDF_StreamAcc>> m_ObjectStreamMap; | 447 std::map<FX_DWORD, std::unique_ptr<CPDF_StreamAcc>> m_ObjectStreamMap; |
| 450 | 448 |
| 451 // Mapping of object numbers to offsets. The offsets are relative to the first | 449 // Mapping of object numbers to offsets. The offsets are relative to the first |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 883 FX_DWORD src_size, | 881 FX_DWORD src_size, |
| 884 const CPDF_Dictionary* pDict, | 882 const CPDF_Dictionary* pDict, |
| 885 uint8_t*& dest_buf, | 883 uint8_t*& dest_buf, |
| 886 FX_DWORD& dest_size, | 884 FX_DWORD& dest_size, |
| 887 CFX_ByteString& ImageEncoding, | 885 CFX_ByteString& ImageEncoding, |
| 888 CPDF_Dictionary*& pImageParms, | 886 CPDF_Dictionary*& pImageParms, |
| 889 FX_DWORD estimated_size, | 887 FX_DWORD estimated_size, |
| 890 FX_BOOL bImageAcc); | 888 FX_BOOL bImageAcc); |
| 891 | 889 |
| 892 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ | 890 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ |
| OLD | NEW |