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