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_OBJECTS_H_ | 7 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_OBJECTS_H_ |
8 #define CORE_INCLUDE_FPDFAPI_FPDF_OBJECTS_H_ | 8 #define CORE_INCLUDE_FPDFAPI_FPDF_OBJECTS_H_ |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 11 matching lines...) Expand all Loading... |
22 class CPDF_Name; | 22 class CPDF_Name; |
23 class CPDF_Null; | 23 class CPDF_Null; |
24 class CPDF_Number; | 24 class CPDF_Number; |
25 class CPDF_Parser; | 25 class CPDF_Parser; |
26 class CPDF_Reference; | 26 class CPDF_Reference; |
27 class CPDF_Stream; | 27 class CPDF_Stream; |
28 class CPDF_StreamAcc; | 28 class CPDF_StreamAcc; |
29 class CPDF_StreamFilter; | 29 class CPDF_StreamFilter; |
30 class CPDF_String; | 30 class CPDF_String; |
31 class IFX_FileRead; | 31 class IFX_FileRead; |
32 struct PARSE_CONTEXT; | |
33 | 32 |
34 #define PDFOBJ_INVALID 0 | 33 #define PDFOBJ_INVALID 0 |
35 #define PDFOBJ_BOOLEAN 1 | 34 #define PDFOBJ_BOOLEAN 1 |
36 #define PDFOBJ_NUMBER 2 | 35 #define PDFOBJ_NUMBER 2 |
37 #define PDFOBJ_STRING 3 | 36 #define PDFOBJ_STRING 3 |
38 #define PDFOBJ_NAME 4 | 37 #define PDFOBJ_NAME 4 |
39 #define PDFOBJ_ARRAY 5 | 38 #define PDFOBJ_ARRAY 5 |
40 #define PDFOBJ_DICTIONARY 6 | 39 #define PDFOBJ_DICTIONARY 6 |
41 #define PDFOBJ_STREAM 7 | 40 #define PDFOBJ_STREAM 7 |
42 #define PDFOBJ_NULL 8 | 41 #define PDFOBJ_NULL 8 |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 } | 559 } |
561 | 560 |
562 class CPDF_IndirectObjectHolder { | 561 class CPDF_IndirectObjectHolder { |
563 public: | 562 public: |
564 using iterator = std::map<FX_DWORD, CPDF_Object*>::iterator; | 563 using iterator = std::map<FX_DWORD, CPDF_Object*>::iterator; |
565 using const_iterator = std::map<FX_DWORD, CPDF_Object*>::const_iterator; | 564 using const_iterator = std::map<FX_DWORD, CPDF_Object*>::const_iterator; |
566 | 565 |
567 explicit CPDF_IndirectObjectHolder(CPDF_Parser* pParser); | 566 explicit CPDF_IndirectObjectHolder(CPDF_Parser* pParser); |
568 ~CPDF_IndirectObjectHolder(); | 567 ~CPDF_IndirectObjectHolder(); |
569 | 568 |
570 CPDF_Object* GetIndirectObject(FX_DWORD objnum, PARSE_CONTEXT* pContext); | 569 CPDF_Object* GetIndirectObject(FX_DWORD objnum); |
571 FX_DWORD AddIndirectObject(CPDF_Object* pObj); | 570 FX_DWORD AddIndirectObject(CPDF_Object* pObj); |
572 void ReleaseIndirectObject(FX_DWORD objnum); | 571 void ReleaseIndirectObject(FX_DWORD objnum); |
573 | 572 |
574 // Takes ownership of |pObj|. | 573 // Takes ownership of |pObj|. |
575 FX_BOOL InsertIndirectObject(FX_DWORD objnum, CPDF_Object* pObj); | 574 FX_BOOL InsertIndirectObject(FX_DWORD objnum, CPDF_Object* pObj); |
576 | 575 |
577 FX_DWORD GetLastObjNum() const { return m_LastObjNum; } | 576 FX_DWORD GetLastObjNum() const { return m_LastObjNum; } |
578 iterator begin() { return m_IndirectObjs.begin(); } | 577 iterator begin() { return m_IndirectObjs.begin(); } |
579 const_iterator begin() const { return m_IndirectObjs.cbegin(); } | 578 const_iterator begin() const { return m_IndirectObjs.cbegin(); } |
580 iterator end() { return m_IndirectObjs.end(); } | 579 iterator end() { return m_IndirectObjs.end(); } |
581 const_iterator end() const { return m_IndirectObjs.end(); } | 580 const_iterator end() const { return m_IndirectObjs.end(); } |
582 | 581 |
583 protected: | 582 protected: |
584 CPDF_Parser* m_pParser; | 583 CPDF_Parser* m_pParser; |
585 FX_DWORD m_LastObjNum; | 584 FX_DWORD m_LastObjNum; |
586 std::map<FX_DWORD, CPDF_Object*> m_IndirectObjs; | 585 std::map<FX_DWORD, CPDF_Object*> m_IndirectObjs; |
587 }; | 586 }; |
588 | 587 |
589 #endif // CORE_INCLUDE_FPDFAPI_FPDF_OBJECTS_H_ | 588 #endif // CORE_INCLUDE_FPDFAPI_FPDF_OBJECTS_H_ |
OLD | NEW |