Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: core/fpdfapi/parser/cpdf_dictionary.h

Issue 2403143002: Add method to convert an indirect object in a dictionary (Closed)
Patch Set: Const ref Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | core/fpdfapi/parser/cpdf_dictionary.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_PARSER_CPDF_DICTIONARY_H_ 7 #ifndef CORE_FPDFAPI_PARSER_CPDF_DICTIONARY_H_
8 #define CORE_FPDFAPI_PARSER_CPDF_DICTIONARY_H_ 8 #define CORE_FPDFAPI_PARSER_CPDF_DICTIONARY_H_
9 9
10 #include <map> 10 #include <map>
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 void SetStringFor(const CFX_ByteString& key, const CFX_ByteString& str); 63 void SetStringFor(const CFX_ByteString& key, const CFX_ByteString& str);
64 void SetIntegerFor(const CFX_ByteString& key, int i); 64 void SetIntegerFor(const CFX_ByteString& key, int i);
65 void SetNumberFor(const CFX_ByteString& key, FX_FLOAT f); 65 void SetNumberFor(const CFX_ByteString& key, FX_FLOAT f);
66 void SetReferenceFor(const CFX_ByteString& key, 66 void SetReferenceFor(const CFX_ByteString& key,
67 CPDF_IndirectObjectHolder* pDoc, 67 CPDF_IndirectObjectHolder* pDoc,
68 uint32_t objnum); 68 uint32_t objnum);
69 void SetRectFor(const CFX_ByteString& key, const CFX_FloatRect& rect); 69 void SetRectFor(const CFX_ByteString& key, const CFX_FloatRect& rect);
70 void SetMatrixFor(const CFX_ByteString& key, const CFX_Matrix& matrix); 70 void SetMatrixFor(const CFX_ByteString& key, const CFX_Matrix& matrix);
71 void SetBooleanFor(const CFX_ByteString& key, bool bValue); 71 void SetBooleanFor(const CFX_ByteString& key, bool bValue);
72 72
73 void ConvertToIndirectObjectFor(const CFX_ByteString& key,
74 CPDF_IndirectObjectHolder* pHolder);
75
73 // Invalidates iterators for the element with the key |key|. 76 // Invalidates iterators for the element with the key |key|.
74 void RemoveFor(const CFX_ByteString& key); 77 void RemoveFor(const CFX_ByteString& key);
75 78
76 // Invalidates iterators for the element with the key |oldkey|. 79 // Invalidates iterators for the element with the key |oldkey|.
77 void ReplaceKey(const CFX_ByteString& oldkey, const CFX_ByteString& newkey); 80 void ReplaceKey(const CFX_ByteString& oldkey, const CFX_ByteString& newkey);
78 81
79 iterator begin() { return m_Map.begin(); } 82 iterator begin() { return m_Map.begin(); }
80 iterator end() { return m_Map.end(); } 83 iterator end() { return m_Map.end(); }
81 const_iterator begin() const { return m_Map.begin(); } 84 const_iterator begin() const { return m_Map.begin(); }
82 const_iterator end() const { return m_Map.end(); } 85 const_iterator end() const { return m_Map.end(); }
83 86
84 CFX_WeakPtr<CFX_ByteStringPool> GetByteStringPool() const { return m_pPool; } 87 CFX_WeakPtr<CFX_ByteStringPool> GetByteStringPool() const { return m_pPool; }
85 88
86 protected: 89 protected:
87 ~CPDF_Dictionary() override; 90 ~CPDF_Dictionary() override;
88 91
89 CFX_ByteString MaybeIntern(const CFX_ByteString& str); 92 CFX_ByteString MaybeIntern(const CFX_ByteString& str);
90 CPDF_Object* CloneNonCyclic( 93 CPDF_Object* CloneNonCyclic(
91 bool bDirect, 94 bool bDirect,
92 std::set<const CPDF_Object*>* visited) const override; 95 std::set<const CPDF_Object*>* visited) const override;
93 96
94 CFX_WeakPtr<CFX_ByteStringPool> m_pPool; 97 CFX_WeakPtr<CFX_ByteStringPool> m_pPool;
95 std::map<CFX_ByteString, CPDF_Object*> m_Map; 98 std::map<CFX_ByteString, CPDF_Object*> m_Map;
96 }; 99 };
97 100
98 #endif // CORE_FPDFAPI_PARSER_CPDF_DICTIONARY_H_ 101 #endif // CORE_FPDFAPI_PARSER_CPDF_DICTIONARY_H_
OLDNEW
« no previous file with comments | « no previous file | core/fpdfapi/parser/cpdf_dictionary.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698