| 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_DICTIONARY_H_ | 7 #ifndef CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DICTIONARY_H_ |
| 8 #define CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DICTIONARY_H_ | 8 #define CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DICTIONARY_H_ |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 bool IsSignatureDict() const; | 58 bool IsSignatureDict() const; |
| 59 | 59 |
| 60 // Set* functions invalidate iterators for the element with the key |key|. | 60 // Set* functions invalidate iterators for the element with the key |key|. |
| 61 void SetAt(const CFX_ByteStringC& key, CPDF_Object* pObj); | 61 void SetAt(const CFX_ByteStringC& key, CPDF_Object* pObj); |
| 62 void SetAtName(const CFX_ByteStringC& key, const CFX_ByteString& name); | 62 void SetAtName(const CFX_ByteStringC& key, const CFX_ByteString& name); |
| 63 void SetAtString(const CFX_ByteStringC& key, const CFX_ByteString& str); | 63 void SetAtString(const CFX_ByteStringC& key, const CFX_ByteString& str); |
| 64 void SetAtInteger(const CFX_ByteStringC& key, int i); | 64 void SetAtInteger(const CFX_ByteStringC& key, int i); |
| 65 void SetAtNumber(const CFX_ByteStringC& key, FX_FLOAT f); | 65 void SetAtNumber(const CFX_ByteStringC& key, FX_FLOAT f); |
| 66 void SetAtReference(const CFX_ByteStringC& key, | 66 void SetAtReference(const CFX_ByteStringC& key, |
| 67 CPDF_IndirectObjectHolder* pDoc, | 67 CPDF_IndirectObjectHolder* pDoc, |
| 68 FX_DWORD objnum); | 68 uint32_t objnum); |
| 69 void SetAtReference(const CFX_ByteStringC& key, | 69 void SetAtReference(const CFX_ByteStringC& key, |
| 70 CPDF_IndirectObjectHolder* pDoc, | 70 CPDF_IndirectObjectHolder* pDoc, |
| 71 CPDF_Object* obj) { | 71 CPDF_Object* obj) { |
| 72 SetAtReference(key, pDoc, obj->GetObjNum()); | 72 SetAtReference(key, pDoc, obj->GetObjNum()); |
| 73 } | 73 } |
| 74 void SetAtRect(const CFX_ByteStringC& key, const CFX_FloatRect& rect); | 74 void SetAtRect(const CFX_ByteStringC& key, const CFX_FloatRect& rect); |
| 75 void SetAtMatrix(const CFX_ByteStringC& key, const CFX_Matrix& matrix); | 75 void SetAtMatrix(const CFX_ByteStringC& key, const CFX_Matrix& matrix); |
| 76 void SetAtBoolean(const CFX_ByteStringC& key, FX_BOOL bValue); | 76 void SetAtBoolean(const CFX_ByteStringC& key, FX_BOOL bValue); |
| 77 | 77 |
| 78 void AddReference(const CFX_ByteStringC& key, | 78 void AddReference(const CFX_ByteStringC& key, |
| 79 CPDF_IndirectObjectHolder* pDoc, | 79 CPDF_IndirectObjectHolder* pDoc, |
| 80 FX_DWORD objnum); | 80 uint32_t objnum); |
| 81 | 81 |
| 82 // Invalidates iterators for the element with the key |key|. | 82 // Invalidates iterators for the element with the key |key|. |
| 83 void RemoveAt(const CFX_ByteStringC& key); | 83 void RemoveAt(const CFX_ByteStringC& key); |
| 84 | 84 |
| 85 // Invalidates iterators for the element with the key |oldkey|. | 85 // Invalidates iterators for the element with the key |oldkey|. |
| 86 void ReplaceKey(const CFX_ByteStringC& oldkey, const CFX_ByteStringC& newkey); | 86 void ReplaceKey(const CFX_ByteStringC& oldkey, const CFX_ByteStringC& newkey); |
| 87 | 87 |
| 88 iterator begin() { return m_Map.begin(); } | 88 iterator begin() { return m_Map.begin(); } |
| 89 iterator end() { return m_Map.end(); } | 89 iterator end() { return m_Map.end(); } |
| 90 const_iterator begin() const { return m_Map.begin(); } | 90 const_iterator begin() const { return m_Map.begin(); } |
| 91 const_iterator end() const { return m_Map.end(); } | 91 const_iterator end() const { return m_Map.end(); } |
| 92 | 92 |
| 93 protected: | 93 protected: |
| 94 ~CPDF_Dictionary() override; | 94 ~CPDF_Dictionary() override; |
| 95 | 95 |
| 96 std::map<CFX_ByteString, CPDF_Object*> m_Map; | 96 std::map<CFX_ByteString, CPDF_Object*> m_Map; |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DICTIONARY_H_ | 99 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DICTIONARY_H_ |
| OLD | NEW |