Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 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_INCLUDE_FPDFAPI_FPDF_OBJECTS_H_ | 7 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_OBJECTS_H_ |
| 8 #define CORE_INCLUDE_FPDFAPI_FPDF_OBJECTS_H_ | 8 #define CORE_INCLUDE_FPDFAPI_FPDF_OBJECTS_H_ |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 378 CPDF_Array* GetArray(const CFX_ByteStringC& key) const; | 378 CPDF_Array* GetArray(const CFX_ByteStringC& key) const; |
| 379 | 379 |
| 380 CFX_FloatRect GetRect(const CFX_ByteStringC& key) const; | 380 CFX_FloatRect GetRect(const CFX_ByteStringC& key) const; |
| 381 | 381 |
| 382 CFX_Matrix GetMatrix(const CFX_ByteStringC& key) const; | 382 CFX_Matrix GetMatrix(const CFX_ByteStringC& key) const; |
| 383 | 383 |
| 384 FX_FLOAT GetFloat(const CFX_ByteStringC& key) const { return GetNumber(key); } | 384 FX_FLOAT GetFloat(const CFX_ByteStringC& key) const { return GetNumber(key); } |
| 385 | 385 |
| 386 FX_BOOL KeyExist(const CFX_ByteStringC& key) const; | 386 FX_BOOL KeyExist(const CFX_ByteStringC& key) const; |
| 387 | 387 |
| 388 // Set* functions invalidates iterators for the given key. | |
|
Lei Zhang
2016/01/14 01:32:29
-> Set* functions invalidates iterators for |key|.
Oliver Chang
2016/01/14 02:04:53
oops, I completely missed this comment, and made m
| |
| 388 void SetAt(const CFX_ByteStringC& key, CPDF_Object* pObj); | 389 void SetAt(const CFX_ByteStringC& key, CPDF_Object* pObj); |
| 389 | 390 |
| 390 void SetAtName(const CFX_ByteStringC& key, const CFX_ByteString& name); | 391 void SetAtName(const CFX_ByteStringC& key, const CFX_ByteString& name); |
| 391 | 392 |
| 392 void SetAtString(const CFX_ByteStringC& key, const CFX_ByteString& string); | 393 void SetAtString(const CFX_ByteStringC& key, const CFX_ByteString& string); |
| 393 | 394 |
| 394 void SetAtInteger(const CFX_ByteStringC& key, int i); | 395 void SetAtInteger(const CFX_ByteStringC& key, int i); |
| 395 | 396 |
| 396 void SetAtNumber(const CFX_ByteStringC& key, FX_FLOAT f); | 397 void SetAtNumber(const CFX_ByteStringC& key, FX_FLOAT f); |
| 397 | 398 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 408 void AddReference(const CFX_ByteStringC& key, | 409 void AddReference(const CFX_ByteStringC& key, |
| 409 CPDF_IndirectObjectHolder* pDoc, | 410 CPDF_IndirectObjectHolder* pDoc, |
| 410 FX_DWORD objnum); | 411 FX_DWORD objnum); |
| 411 | 412 |
| 412 void SetAtRect(const CFX_ByteStringC& key, const CFX_FloatRect& rect); | 413 void SetAtRect(const CFX_ByteStringC& key, const CFX_FloatRect& rect); |
| 413 | 414 |
| 414 void SetAtMatrix(const CFX_ByteStringC& key, const CFX_Matrix& matrix); | 415 void SetAtMatrix(const CFX_ByteStringC& key, const CFX_Matrix& matrix); |
| 415 | 416 |
| 416 void SetAtBoolean(const CFX_ByteStringC& key, FX_BOOL bValue); | 417 void SetAtBoolean(const CFX_ByteStringC& key, FX_BOOL bValue); |
| 417 | 418 |
| 419 // Invalidates iterators for the given key. | |
| 418 void RemoveAt(const CFX_ByteStringC& key); | 420 void RemoveAt(const CFX_ByteStringC& key); |
| 419 | 421 |
| 422 // Invalidates iterators for oldkey. | |
| 420 void ReplaceKey(const CFX_ByteStringC& oldkey, const CFX_ByteStringC& newkey); | 423 void ReplaceKey(const CFX_ByteStringC& oldkey, const CFX_ByteStringC& newkey); |
| 421 | 424 |
| 422 FX_BOOL Identical(CPDF_Dictionary* pDict) const; | 425 FX_BOOL Identical(CPDF_Dictionary* pDict) const; |
| 423 | 426 |
| 424 size_t GetCount() const { return m_Map.size(); } | 427 size_t GetCount() const { return m_Map.size(); } |
| 425 | 428 |
| 426 iterator begin() { return m_Map.begin(); } | 429 iterator begin() { return m_Map.begin(); } |
| 427 | 430 |
| 428 iterator end() { return m_Map.end(); } | 431 iterator end() { return m_Map.end(); } |
| 429 | 432 |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 596 iterator end() { return m_IndirectObjs.end(); } | 599 iterator end() { return m_IndirectObjs.end(); } |
| 597 const_iterator end() const { return m_IndirectObjs.end(); } | 600 const_iterator end() const { return m_IndirectObjs.end(); } |
| 598 | 601 |
| 599 protected: | 602 protected: |
| 600 CPDF_Parser* m_pParser; | 603 CPDF_Parser* m_pParser; |
| 601 FX_DWORD m_LastObjNum; | 604 FX_DWORD m_LastObjNum; |
| 602 std::map<FX_DWORD, CPDF_Object*> m_IndirectObjs; | 605 std::map<FX_DWORD, CPDF_Object*> m_IndirectObjs; |
| 603 }; | 606 }; |
| 604 | 607 |
| 605 #endif // CORE_INCLUDE_FPDFAPI_FPDF_OBJECTS_H_ | 608 #endif // CORE_INCLUDE_FPDFAPI_FPDF_OBJECTS_H_ |
| OLD | NEW |