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/stl_util.h" 18 19 CPDF_Object::~CPDF_Object() {} 20 21 CPDF_Object* CPDF_Object::GetDirect() const { 22 return const_cast<CPDF_Object*>(this); 23 } 24 25 std::unique_ptr<CPDF_Object> CPDF_Object::CloneObjectNonCyclic( 26 bool bDirect) const { 27 std::set<const CPDF_Object*> visited_objs; 28 return CloneNonCyclic(bDirect, &visited_objs); 29 } 30 31 std::unique_ptr<CPDF_Object> CPDF_Object::CloneDirectObject() const { 32 return CloneObjectNonCyclic(true); 33 } 34 35 std::unique_ptr<CPDF_Object> CPDF_Object::CloneNonCyclic( 36 bool bDirect, 37 std::set<const CPDF_Object*>* pVisited) const { 38 return Clone(); 39 } 40 41 CFX_ByteString CPDF_Object::GetString() const { 42 return CFX_ByteString(); 43 } 44 45 CFX_WideString CPDF_Object::GetUnicodeText() const { 46 return CFX_WideString(); 47 } 48 49 FX_FLOAT CPDF_Object::GetNumber() const { 50 return 0; 51 } 52 53 int CPDF_Object::GetInteger() const { 54 return 0; 55 } 56 57 CPDF_Dictionary* CPDF_Object::GetDict() const { 58 return nullptr; 59 } 60 61 void CPDF_Object::SetString(const CFX_ByteString& str) { 62 ASSERT(false); 63 } 64 65 bool CPDF_Object::IsArray() const { 66 return false; 67 } 68 69 bool CPDF_Object::IsBoolean() const { 70 return false; 71 } 72 73 bool CPDF_Object::IsDictionary() const { 74 return false; 75 } 76 77 bool CPDF_Object::IsName() const { 78 return false; 79 } 80 81 bool CPDF_Object::IsNumber() const { 82 return false; 83 } 84 85 bool CPDF_Object::IsReference() const { 86 return false; 87 } 88 89 bool CPDF_Object::IsStream() const { 90 return false; 91 } 92 93 bool CPDF_Object::IsString() const { 94 return false; 95 } 96 97 CPDF_Array* CPDF_Object::AsArray() { 98 return nullptr; 99 } 100 101 const CPDF_Array* CPDF_Object::AsArray() const { 102 return nullptr; 103 } 104 105 CPDF_Boolean* CPDF_Object::AsBoolean() { 106 return nullptr; 107 } 108 109 const CPDF_Boolean* CPDF_Object::AsBoolean() const { 110 return nullptr; 111 } 112 113 CPDF_Dictionary* CPDF_Object::AsDictionary() { 114 return nullptr; 115 } 116 117 const CPDF_Dictionary* CPDF_Object::AsDictionary() const { 118 return nullptr; 119 } 120 121 CPDF_Name* CPDF_Object::AsName() { 122 return nullptr; 123 } 124 125 const CPDF_Name* CPDF_Object::AsName() const { 126 return nullptr; 127 } 128 129 CPDF_Number* CPDF_Object::AsNumber() { 130 return nullptr; 131 } 132 133 const CPDF_Number* CPDF_Object::AsNumber() const { 134 return nullptr; 135 } 136 137 CPDF_Reference* CPDF_Object::AsReference() { 138 return nullptr; 139 } 140 141 const CPDF_Reference* CPDF_Object::AsReference() const { 142 return nullptr; 143 } 144 145 CPDF_Stream* CPDF_Object::AsStream() { 146 return nullptr; 147 } 148 149 const CPDF_Stream* CPDF_Object::AsStream() const { 150 return nullptr; 151 } 152 153 CPDF_String* CPDF_Object::AsString() { 154 return nullptr; 155 } 156 157 const CPDF_String* CPDF_Object::AsString() const { 158 return nullptr; 159 } 160