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

Side by Side Diff: core/fpdfapi/fpdf_parser/include/cpdf_object.h

Issue 2253723002: Move parser pointer to CPDF_Document (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Review Created 4 years, 4 months 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
OLDNEW
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
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
82 CPDF_Object() : m_ObjNum(0), m_GenNum(0) {} 86 CPDF_Object() : m_ObjNum(0), m_GenNum(0) {}
83 virtual ~CPDF_Object(); 87 virtual ~CPDF_Object();
84 void Destroy() { delete this; } 88 void Destroy() { delete this; }
85 89
86 uint32_t m_ObjNum; 90 uint32_t m_ObjNum;
87 uint32_t m_GenNum; 91 uint32_t m_GenNum;
88 92
89 friend class CPDF_IndirectObjectHolder;
90 friend class CPDF_Parser;
91
92 private: 93 private:
93 CPDF_Object(const CPDF_Object& src) {} 94 CPDF_Object(const CPDF_Object& src) {}
94 }; 95 };
95 96
96 inline CPDF_Boolean* ToBoolean(CPDF_Object* obj) { 97 inline CPDF_Boolean* ToBoolean(CPDF_Object* obj) {
97 return obj ? obj->AsBoolean() : nullptr; 98 return obj ? obj->AsBoolean() : nullptr;
98 } 99 }
99 100
100 inline const CPDF_Boolean* ToBoolean(const CPDF_Object* obj) { 101 inline const CPDF_Boolean* ToBoolean(const CPDF_Object* obj) {
101 return obj ? obj->AsBoolean() : nullptr; 102 return obj ? obj->AsBoolean() : nullptr;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 151
151 inline CPDF_Stream* ToStream(CPDF_Object* obj) { 152 inline CPDF_Stream* ToStream(CPDF_Object* obj) {
152 return obj ? obj->AsStream() : nullptr; 153 return obj ? obj->AsStream() : nullptr;
153 } 154 }
154 155
155 inline const CPDF_Stream* ToStream(const CPDF_Object* obj) { 156 inline const CPDF_Stream* ToStream(const CPDF_Object* obj) {
156 return obj ? obj->AsStream() : nullptr; 157 return obj ? obj->AsStream() : nullptr;
157 } 158 }
158 159
159 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_OBJECT_H_ 160 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698