| 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 "core/fxcrt/include/fx_string.h" | 10 #include "core/fxcrt/include/fx_string.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 virtual CPDF_Number* AsNumber(); | 72 virtual CPDF_Number* AsNumber(); |
| 73 virtual const CPDF_Number* AsNumber() const; | 73 virtual const CPDF_Number* AsNumber() const; |
| 74 virtual CPDF_Reference* AsReference(); | 74 virtual CPDF_Reference* AsReference(); |
| 75 virtual const CPDF_Reference* AsReference() const; | 75 virtual const CPDF_Reference* AsReference() const; |
| 76 virtual CPDF_Stream* AsStream(); | 76 virtual CPDF_Stream* AsStream(); |
| 77 virtual const CPDF_Stream* AsStream() const; | 77 virtual const CPDF_Stream* AsStream() const; |
| 78 virtual CPDF_String* AsString(); | 78 virtual CPDF_String* AsString(); |
| 79 virtual const CPDF_String* AsString() const; | 79 virtual const CPDF_String* AsString() const; |
| 80 | 80 |
| 81 protected: | 81 protected: |
| 82 friend class CPDF_Document; | |
| 83 friend class CPDF_IndirectObjectHolder; | |
| 84 friend class CPDF_Parser; | |
| 85 | |
| 86 CPDF_Object() : m_ObjNum(0), m_GenNum(0) {} | 82 CPDF_Object() : m_ObjNum(0), m_GenNum(0) {} |
| 87 virtual ~CPDF_Object(); | 83 virtual ~CPDF_Object(); |
| 88 void Destroy() { delete this; } | 84 void Destroy() { delete this; } |
| 89 | 85 |
| 90 uint32_t m_ObjNum; | 86 uint32_t m_ObjNum; |
| 91 uint32_t m_GenNum; | 87 uint32_t m_GenNum; |
| 92 | 88 |
| 89 friend class CPDF_IndirectObjectHolder; |
| 90 friend class CPDF_Parser; |
| 91 |
| 93 private: | 92 private: |
| 94 CPDF_Object(const CPDF_Object& src) {} | 93 CPDF_Object(const CPDF_Object& src) {} |
| 95 }; | 94 }; |
| 96 | 95 |
| 97 inline CPDF_Boolean* ToBoolean(CPDF_Object* obj) { | 96 inline CPDF_Boolean* ToBoolean(CPDF_Object* obj) { |
| 98 return obj ? obj->AsBoolean() : nullptr; | 97 return obj ? obj->AsBoolean() : nullptr; |
| 99 } | 98 } |
| 100 | 99 |
| 101 inline const CPDF_Boolean* ToBoolean(const CPDF_Object* obj) { | 100 inline const CPDF_Boolean* ToBoolean(const CPDF_Object* obj) { |
| 102 return obj ? obj->AsBoolean() : nullptr; | 101 return obj ? obj->AsBoolean() : nullptr; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 150 |
| 152 inline CPDF_Stream* ToStream(CPDF_Object* obj) { | 151 inline CPDF_Stream* ToStream(CPDF_Object* obj) { |
| 153 return obj ? obj->AsStream() : nullptr; | 152 return obj ? obj->AsStream() : nullptr; |
| 154 } | 153 } |
| 155 | 154 |
| 156 inline const CPDF_Stream* ToStream(const CPDF_Object* obj) { | 155 inline const CPDF_Stream* ToStream(const CPDF_Object* obj) { |
| 157 return obj ? obj->AsStream() : nullptr; | 156 return obj ? obj->AsStream() : nullptr; |
| 158 } | 157 } |
| 159 | 158 |
| 160 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_OBJECT_H_ | 159 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_OBJECT_H_ |
| OLD | NEW |