Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: core/include/fpdfapi/fpdf_objects.h

Issue 1414393006: Revert "Add type cast definitions for CPDF_Reference." (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "../fxcrt/fx_coordinates.h" 10 #include "../fxcrt/fx_coordinates.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 int GetDirectType() const; 78 int GetDirectType() const;
79 79
80 FX_BOOL IsModified() const { return FALSE; } 80 FX_BOOL IsModified() const { return FALSE; }
81 81
82 bool IsArray() const { return m_Type == PDFOBJ_ARRAY; } 82 bool IsArray() const { return m_Type == PDFOBJ_ARRAY; }
83 bool IsBoolean() const { return m_Type == PDFOBJ_BOOLEAN; } 83 bool IsBoolean() const { return m_Type == PDFOBJ_BOOLEAN; }
84 bool IsDictionary() const { return m_Type == PDFOBJ_DICTIONARY; } 84 bool IsDictionary() const { return m_Type == PDFOBJ_DICTIONARY; }
85 bool IsName() const { return m_Type == PDFOBJ_NAME; } 85 bool IsName() const { return m_Type == PDFOBJ_NAME; }
86 bool IsNumber() const { return m_Type == PDFOBJ_NUMBER; } 86 bool IsNumber() const { return m_Type == PDFOBJ_NUMBER; }
87 bool IsReference() const { return m_Type == PDFOBJ_REFERENCE; }
88 bool IsStream() const { return m_Type == PDFOBJ_STREAM; } 87 bool IsStream() const { return m_Type == PDFOBJ_STREAM; }
89 bool IsString() const { return m_Type == PDFOBJ_STRING; } 88 bool IsString() const { return m_Type == PDFOBJ_STRING; }
90 89
91 CPDF_Array* AsArray(); 90 CPDF_Array* AsArray();
92 const CPDF_Array* AsArray() const; 91 const CPDF_Array* AsArray() const;
93 92
94 CPDF_Boolean* AsBoolean(); 93 CPDF_Boolean* AsBoolean();
95 const CPDF_Boolean* AsBoolean() const; 94 const CPDF_Boolean* AsBoolean() const;
96 95
97 CPDF_Dictionary* AsDictionary(); 96 CPDF_Dictionary* AsDictionary();
98 const CPDF_Dictionary* AsDictionary() const; 97 const CPDF_Dictionary* AsDictionary() const;
99 98
100 CPDF_Name* AsName(); 99 CPDF_Name* AsName();
101 const CPDF_Name* AsName() const; 100 const CPDF_Name* AsName() const;
102 101
103 CPDF_Number* AsNumber(); 102 CPDF_Number* AsNumber();
104 const CPDF_Number* AsNumber() const; 103 const CPDF_Number* AsNumber() const;
105 104
106 CPDF_Reference* AsReference();
107 const CPDF_Reference* AsReference() const;
108
109 CPDF_Stream* AsStream(); 105 CPDF_Stream* AsStream();
110 const CPDF_Stream* AsStream() const; 106 const CPDF_Stream* AsStream() const;
111 107
112 CPDF_String* AsString(); 108 CPDF_String* AsString();
113 const CPDF_String* AsString() const; 109 const CPDF_String* AsString() const;
114 110
115 protected: 111 protected:
116 CPDF_Object(FX_DWORD type) : m_Type(type), m_ObjNum(0), m_GenNum(0) {} 112 CPDF_Object(FX_DWORD type) : m_Type(type), m_ObjNum(0), m_GenNum(0) {}
117 ~CPDF_Object() {} 113 ~CPDF_Object() {}
118 void Destroy(); 114 void Destroy();
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 FX_BOOL Identical(CPDF_Reference* pOther) const { 593 FX_BOOL Identical(CPDF_Reference* pOther) const {
598 return m_RefObjNum == pOther->m_RefObjNum; 594 return m_RefObjNum == pOther->m_RefObjNum;
599 } 595 }
600 596
601 protected: 597 protected:
602 CPDF_IndirectObjects* m_pObjList; 598 CPDF_IndirectObjects* m_pObjList;
603 599
604 FX_DWORD m_RefObjNum; 600 FX_DWORD m_RefObjNum;
605 friend class CPDF_Object; 601 friend class CPDF_Object;
606 }; 602 };
607 inline CPDF_Reference* ToReference(CPDF_Object* obj) {
608 return obj ? obj->AsReference() : nullptr;
609 }
610 inline const CPDF_Reference* ToReference(const CPDF_Object* obj) {
611 return obj ? obj->AsReference() : nullptr;
612 }
613
614 class CPDF_IndirectObjects { 603 class CPDF_IndirectObjects {
615 public: 604 public:
616 CPDF_IndirectObjects(CPDF_Parser* pParser); 605 CPDF_IndirectObjects(CPDF_Parser* pParser);
617 606
618 ~CPDF_IndirectObjects(); 607 ~CPDF_IndirectObjects();
619 608
620 CPDF_Object* GetIndirectObject(FX_DWORD objnum, 609 CPDF_Object* GetIndirectObject(FX_DWORD objnum,
621 struct PARSE_CONTEXT* pContext = NULL); 610 struct PARSE_CONTEXT* pContext = NULL);
622 611
623 int GetIndirectType(FX_DWORD objnum); 612 int GetIndirectType(FX_DWORD objnum);
(...skipping 18 matching lines...) Expand all
642 631
643 protected: 632 protected:
644 CFX_MapPtrToPtr m_IndirectObjs; 633 CFX_MapPtrToPtr m_IndirectObjs;
645 634
646 CPDF_Parser* m_pParser; 635 CPDF_Parser* m_pParser;
647 636
648 FX_DWORD m_LastObjNum; 637 FX_DWORD m_LastObjNum;
649 }; 638 };
650 639
651 #endif // CORE_INCLUDE_FPDFAPI_FPDF_OBJECTS_H_ 640 #endif // CORE_INCLUDE_FPDFAPI_FPDF_OBJECTS_H_
OLDNEW
« no previous file with comments | « no previous file | core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698