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_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_OBJECT_H_ | 7 #ifndef CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_OBJECT_H_ |
8 #define CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_OBJECT_H_ | 8 #define CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_OBJECT_H_ |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 friend class CPDF_Array; | 88 friend class CPDF_Array; |
89 friend class CPDF_Dictionary; | 89 friend class CPDF_Dictionary; |
90 friend class CPDF_Document; | 90 friend class CPDF_Document; |
91 friend class CPDF_IndirectObjectHolder; | 91 friend class CPDF_IndirectObjectHolder; |
92 friend class CPDF_Parser; | 92 friend class CPDF_Parser; |
93 friend class CPDF_Reference; | 93 friend class CPDF_Reference; |
94 friend class CPDF_Stream; | 94 friend class CPDF_Stream; |
95 | 95 |
96 CPDF_Object() : m_ObjNum(0), m_GenNum(0) {} | 96 CPDF_Object() : m_ObjNum(0), m_GenNum(0) {} |
97 virtual ~CPDF_Object(); | 97 virtual ~CPDF_Object(); |
98 void Destroy() { delete this; } | |
99 | 98 |
100 CPDF_Object* CloneObjectNonCyclic(bool bDirect) const; | 99 CPDF_Object* CloneObjectNonCyclic(bool bDirect) const; |
101 | 100 |
102 // Create a deep copy of the object with the option to either | 101 // Create a deep copy of the object with the option to either |
103 // copy a reference object or directly copy the object it refers to | 102 // copy a reference object or directly copy the object it refers to |
104 // when |bDirect| is true. | 103 // when |bDirect| is true. |
105 // Also check cyclic reference against |pVisited|, no copy if it is found. | 104 // Also check cyclic reference against |pVisited|, no copy if it is found. |
106 // Complex objects should implement their own CloneNonCyclic() | 105 // Complex objects should implement their own CloneNonCyclic() |
107 // function to properly check for possible loop. | 106 // function to properly check for possible loop. |
108 virtual CPDF_Object* CloneNonCyclic( | 107 virtual CPDF_Object* CloneNonCyclic( |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 172 |
174 inline CPDF_Stream* ToStream(CPDF_Object* obj) { | 173 inline CPDF_Stream* ToStream(CPDF_Object* obj) { |
175 return obj ? obj->AsStream() : nullptr; | 174 return obj ? obj->AsStream() : nullptr; |
176 } | 175 } |
177 | 176 |
178 inline const CPDF_Stream* ToStream(const CPDF_Object* obj) { | 177 inline const CPDF_Stream* ToStream(const CPDF_Object* obj) { |
179 return obj ? obj->AsStream() : nullptr; | 178 return obj ? obj->AsStream() : nullptr; |
180 } | 179 } |
181 | 180 |
182 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_OBJECT_H_ | 181 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_OBJECT_H_ |
OLD | NEW |