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 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" | 7 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" |
8 | 8 |
9 #include "core/fpdfapi/fpdf_parser/include/cpdf_name.h" | 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_name.h" |
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_number.h" | 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_number.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 return nullptr; | 85 return nullptr; |
86 return m_Objects.at(i)->GetDirect(); | 86 return m_Objects.at(i)->GetDirect(); |
87 } | 87 } |
88 | 88 |
89 CFX_ByteString CPDF_Array::GetStringAt(size_t i) const { | 89 CFX_ByteString CPDF_Array::GetStringAt(size_t i) const { |
90 if (i >= m_Objects.size()) | 90 if (i >= m_Objects.size()) |
91 return CFX_ByteString(); | 91 return CFX_ByteString(); |
92 return m_Objects.at(i)->GetString(); | 92 return m_Objects.at(i)->GetString(); |
93 } | 93 } |
94 | 94 |
95 CFX_ByteStringC CPDF_Array::GetConstStringAt(size_t i) const { | |
96 if (i >= m_Objects.size()) | |
97 return CFX_ByteStringC(); | |
98 return m_Objects.at(i)->GetConstString(); | |
99 } | |
100 | |
101 int CPDF_Array::GetIntegerAt(size_t i) const { | 95 int CPDF_Array::GetIntegerAt(size_t i) const { |
102 if (i >= m_Objects.size()) | 96 if (i >= m_Objects.size()) |
103 return 0; | 97 return 0; |
104 return m_Objects.at(i)->GetInteger(); | 98 return m_Objects.at(i)->GetInteger(); |
105 } | 99 } |
106 | 100 |
107 FX_FLOAT CPDF_Array::GetNumberAt(size_t i) const { | 101 FX_FLOAT CPDF_Array::GetNumberAt(size_t i) const { |
108 if (i >= m_Objects.size()) | 102 if (i >= m_Objects.size()) |
109 return 0; | 103 return 0; |
110 return m_Objects.at(i)->GetNumber(); | 104 return m_Objects.at(i)->GetNumber(); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 ASSERT(IsArray()); | 197 ASSERT(IsArray()); |
204 CPDF_Number* pNumber = new CPDF_Number(f); | 198 CPDF_Number* pNumber = new CPDF_Number(f); |
205 Add(pNumber); | 199 Add(pNumber); |
206 } | 200 } |
207 | 201 |
208 void CPDF_Array::AddReference(CPDF_IndirectObjectHolder* pDoc, | 202 void CPDF_Array::AddReference(CPDF_IndirectObjectHolder* pDoc, |
209 uint32_t objnum) { | 203 uint32_t objnum) { |
210 ASSERT(IsArray()); | 204 ASSERT(IsArray()); |
211 Add(new CPDF_Reference(pDoc, objnum)); | 205 Add(new CPDF_Reference(pDoc, objnum)); |
212 } | 206 } |
OLD | NEW |