1 // Copyright 2016 PDFium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #include "core/fpdfapi/parser/cpdf_object.h" 8 9 #include <algorithm> 10 11 #include "core/fpdfapi/parser/cpdf_array.h" 12 #include "core/fpdfapi/parser/cpdf_dictionary.h" 13 #include "core/fpdfapi/parser/cpdf_indirect_object_holder.h" 14 #include "core/fpdfapi/parser/cpdf_parser.h" 15 #include "core/fpdfapi/parser/fpdf_parser_decode.h" 16 #include "core/fxcrt/fx_string.h" 17 #include "third_party/base/logging.h" 18 #include "third_party/base/stl_util.h" 19 ~CPDF_Object()20CPDF_Object::~CPDF_Object() {} 21 GetDirect() const22CPDF_Object* CPDF_Object::GetDirect() const { 23 return const_cast<CPDF_Object*>(this); 24 } 25 CloneObjectNonCyclic(bool bDirect) const26std::unique_ptr<CPDF_Object> CPDF_Object::CloneObjectNonCyclic( 27 bool bDirect) const { 28 std::set<const CPDF_Object*> visited_objs; 29 return CloneNonCyclic(bDirect, &visited_objs); 30 } 31 CloneDirectObject() const32std::unique_ptr<CPDF_Object> CPDF_Object::CloneDirectObject() const { 33 return CloneObjectNonCyclic(true); 34 } 35 CloneNonCyclic(bool bDirect,std::set<const CPDF_Object * > * pVisited) const36std::unique_ptr<CPDF_Object> CPDF_Object::CloneNonCyclic( 37 bool bDirect, 38 std::set<const CPDF_Object*>* pVisited) const { 39 return Clone(); 40 } 41 GetString() const42ByteString CPDF_Object::GetString() const { 43 return ByteString(); 44 } 45 GetUnicodeText() const46WideString CPDF_Object::GetUnicodeText() const { 47 return WideString(); 48 } 49 GetNumber() const50float CPDF_Object::GetNumber() const { 51 return 0; 52 } 53 GetInteger() const54int CPDF_Object::GetInteger() const { 55 return 0; 56 } 57 GetDict() const58CPDF_Dictionary* CPDF_Object::GetDict() const { 59 return nullptr; 60 } 61 SetString(const ByteString & str)62void CPDF_Object::SetString(const ByteString& str) { 63 NOTREACHED(); 64 } 65 IsArray() const66bool CPDF_Object::IsArray() const { 67 return false; 68 } 69 IsBoolean() const70bool CPDF_Object::IsBoolean() const { 71 return false; 72 } 73 IsDictionary() const74bool CPDF_Object::IsDictionary() const { 75 return false; 76 } 77 IsName() const78bool CPDF_Object::IsName() const { 79 return false; 80 } 81 IsNumber() const82bool CPDF_Object::IsNumber() const { 83 return false; 84 } 85 IsReference() const86bool CPDF_Object::IsReference() const { 87 return false; 88 } 89 IsStream() const90bool CPDF_Object::IsStream() const { 91 return false; 92 } 93 IsString() const94bool CPDF_Object::IsString() const { 95 return false; 96 } 97 IsNull() const98bool CPDF_Object::IsNull() const { 99 return false; 100 } 101 AsArray()102CPDF_Array* CPDF_Object::AsArray() { 103 return nullptr; 104 } 105 AsArray() const106const CPDF_Array* CPDF_Object::AsArray() const { 107 return nullptr; 108 } 109 AsBoolean()110CPDF_Boolean* CPDF_Object::AsBoolean() { 111 return nullptr; 112 } 113 AsBoolean() const114const CPDF_Boolean* CPDF_Object::AsBoolean() const { 115 return nullptr; 116 } 117 AsDictionary()118CPDF_Dictionary* CPDF_Object::AsDictionary() { 119 return nullptr; 120 } 121 AsDictionary() const122const CPDF_Dictionary* CPDF_Object::AsDictionary() const { 123 return nullptr; 124 } 125 AsName()126CPDF_Name* CPDF_Object::AsName() { 127 return nullptr; 128 } 129 AsName() const130const CPDF_Name* CPDF_Object::AsName() const { 131 return nullptr; 132 } 133 AsNumber()134CPDF_Number* CPDF_Object::AsNumber() { 135 return nullptr; 136 } 137 AsNumber() const138const CPDF_Number* CPDF_Object::AsNumber() const { 139 return nullptr; 140 } 141 AsReference()142CPDF_Reference* CPDF_Object::AsReference() { 143 return nullptr; 144 } 145 AsReference() const146const CPDF_Reference* CPDF_Object::AsReference() const { 147 return nullptr; 148 } 149 AsStream()150CPDF_Stream* CPDF_Object::AsStream() { 151 return nullptr; 152 } 153 AsStream() const154const CPDF_Stream* CPDF_Object::AsStream() const { 155 return nullptr; 156 } 157 AsString()158CPDF_String* CPDF_Object::AsString() { 159 return nullptr; 160 } 161 AsString() const162const CPDF_String* CPDF_Object::AsString() const { 163 return nullptr; 164 } 165