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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 using StreamObjectCache = std::map<FX_DWORD, FX_DWORD>; | 443 using StreamObjectCache = std::map<FX_DWORD, FX_DWORD>; |
444 | 444 |
445 // Mapping of streams to their object caches. This is valid as long as the | 445 // Mapping of streams to their object caches. This is valid as long as the |
446 // streams in |m_ObjectStreamMap| are valid. | 446 // streams in |m_ObjectStreamMap| are valid. |
447 std::map<CPDF_StreamAcc*, StreamObjectCache> m_ObjCache; | 447 std::map<CPDF_StreamAcc*, StreamObjectCache> m_ObjCache; |
448 | 448 |
449 // All indirect object numbers that are being parsed. | 449 // All indirect object numbers that are being parsed. |
450 std::set<FX_DWORD> m_ParsingObjNums; | 450 std::set<FX_DWORD> m_ParsingObjNums; |
451 | 451 |
452 friend class CPDF_DataAvail; | 452 friend class CPDF_DataAvail; |
| 453 |
| 454 private: |
| 455 enum class ParserState { |
| 456 kDefault, |
| 457 kComment, |
| 458 kWhitespace, |
| 459 kString, |
| 460 kHexString, |
| 461 kEscapedString, |
| 462 kXref, |
| 463 kObjNum, |
| 464 kPostObjNum, |
| 465 kGenNum, |
| 466 kPostGenNum, |
| 467 kTrailer, |
| 468 kBeginObj, |
| 469 kEndObj |
| 470 }; |
453 }; | 471 }; |
454 | 472 |
455 #define FXCIPHER_NONE 0 | 473 #define FXCIPHER_NONE 0 |
456 #define FXCIPHER_RC4 1 | 474 #define FXCIPHER_RC4 1 |
457 #define FXCIPHER_AES 2 | 475 #define FXCIPHER_AES 2 |
458 #define FXCIPHER_AES2 3 | 476 #define FXCIPHER_AES2 3 |
459 | 477 |
460 class IPDF_SecurityHandler { | 478 class IPDF_SecurityHandler { |
461 public: | 479 public: |
462 virtual ~IPDF_SecurityHandler() {} | 480 virtual ~IPDF_SecurityHandler() {} |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 FX_DWORD src_size, | 891 FX_DWORD src_size, |
874 const CPDF_Dictionary* pDict, | 892 const CPDF_Dictionary* pDict, |
875 uint8_t*& dest_buf, | 893 uint8_t*& dest_buf, |
876 FX_DWORD& dest_size, | 894 FX_DWORD& dest_size, |
877 CFX_ByteString& ImageEncoding, | 895 CFX_ByteString& ImageEncoding, |
878 CPDF_Dictionary*& pImageParms, | 896 CPDF_Dictionary*& pImageParms, |
879 FX_DWORD estimated_size, | 897 FX_DWORD estimated_size, |
880 FX_BOOL bImageAcc); | 898 FX_BOOL bImageAcc); |
881 | 899 |
882 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ | 900 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ |
OLD | NEW |