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 #ifndef CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_ARRAY_H_ | 7 #ifndef CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_ARRAY_H_ |
8 #define CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_ARRAY_H_ | 8 #define CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_ARRAY_H_ |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 25 matching lines...) Expand all Loading... |
36 CFX_ByteString GetStringAt(size_t index) const; | 36 CFX_ByteString GetStringAt(size_t index) const; |
37 int GetIntegerAt(size_t index) const; | 37 int GetIntegerAt(size_t index) const; |
38 FX_FLOAT GetNumberAt(size_t index) const; | 38 FX_FLOAT GetNumberAt(size_t index) const; |
39 CPDF_Dictionary* GetDictAt(size_t index) const; | 39 CPDF_Dictionary* GetDictAt(size_t index) const; |
40 CPDF_Stream* GetStreamAt(size_t index) const; | 40 CPDF_Stream* GetStreamAt(size_t index) const; |
41 CPDF_Array* GetArrayAt(size_t index) const; | 41 CPDF_Array* GetArrayAt(size_t index) const; |
42 FX_FLOAT GetFloatAt(size_t index) const { return GetNumberAt(index); } | 42 FX_FLOAT GetFloatAt(size_t index) const { return GetNumberAt(index); } |
43 CFX_Matrix GetMatrix(); | 43 CFX_Matrix GetMatrix(); |
44 CFX_FloatRect GetRect(); | 44 CFX_FloatRect GetRect(); |
45 | 45 |
46 void SetAt(size_t index, | 46 void SetAt(size_t index, CPDF_Object* pObj); |
47 CPDF_Object* pObj, | 47 void InsertAt(size_t index, CPDF_Object* pObj); |
48 CPDF_IndirectObjectHolder* pObjs = nullptr); | |
49 void InsertAt(size_t index, | |
50 CPDF_Object* pObj, | |
51 CPDF_IndirectObjectHolder* pObjs = nullptr); | |
52 void RemoveAt(size_t index, size_t nCount = 1); | 48 void RemoveAt(size_t index, size_t nCount = 1); |
53 | 49 |
54 void Add(CPDF_Object* pObj, CPDF_IndirectObjectHolder* pObjs = nullptr); | 50 void Add(CPDF_Object* pObj); |
55 void AddNumber(FX_FLOAT f); | 51 void AddNumber(FX_FLOAT f); |
56 void AddInteger(int i); | 52 void AddInteger(int i); |
57 void AddString(const CFX_ByteString& str); | 53 void AddString(const CFX_ByteString& str); |
58 void AddName(const CFX_ByteString& str); | 54 void AddName(const CFX_ByteString& str); |
59 void AddReference(CPDF_IndirectObjectHolder* pDoc, uint32_t objnum); | 55 void AddReference(CPDF_IndirectObjectHolder* pDoc, uint32_t objnum); |
60 void AddReference(CPDF_IndirectObjectHolder* pDoc, CPDF_Object* obj) { | 56 void AddReference(CPDF_IndirectObjectHolder* pDoc, CPDF_Object* obj) { |
61 AddReference(pDoc, obj->GetObjNum()); | 57 AddReference(pDoc, obj->GetObjNum()); |
62 } | 58 } |
63 | 59 |
64 iterator begin() { return m_Objects.begin(); } | 60 iterator begin() { return m_Objects.begin(); } |
65 iterator end() { return m_Objects.end(); } | 61 iterator end() { return m_Objects.end(); } |
66 const_iterator begin() const { return m_Objects.begin(); } | 62 const_iterator begin() const { return m_Objects.begin(); } |
67 const_iterator end() const { return m_Objects.end(); } | 63 const_iterator end() const { return m_Objects.end(); } |
68 | 64 |
69 protected: | 65 protected: |
70 ~CPDF_Array() override; | 66 ~CPDF_Array() override; |
71 | 67 |
72 CPDF_Object* CloneNonCyclic( | 68 CPDF_Object* CloneNonCyclic( |
73 bool bDirect, | 69 bool bDirect, |
74 std::set<const CPDF_Object*>* pVisited) const override; | 70 std::set<const CPDF_Object*>* pVisited) const override; |
75 | 71 |
76 std::vector<CPDF_Object*> m_Objects; | 72 std::vector<CPDF_Object*> m_Objects; |
77 }; | 73 }; |
78 | 74 |
79 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_ARRAY_H_ | 75 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_ARRAY_H_ |
OLD | NEW |