| 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_PARSER_CPDF_ARRAY_H_ |   7 #ifndef CORE_FPDFAPI_PARSER_CPDF_ARRAY_H_ | 
|   8 #define CORE_FPDFAPI_PARSER_CPDF_ARRAY_H_ |   8 #define CORE_FPDFAPI_PARSER_CPDF_ARRAY_H_ | 
|   9  |   9  | 
|  10 #include <set> |  10 #include <set> | 
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  62  |  62  | 
|  63  protected: |  63  protected: | 
|  64   ~CPDF_Array() override; |  64   ~CPDF_Array() override; | 
|  65  |  65  | 
|  66   CPDF_Object* CloneNonCyclic( |  66   CPDF_Object* CloneNonCyclic( | 
|  67       bool bDirect, |  67       bool bDirect, | 
|  68       std::set<const CPDF_Object*>* pVisited) const override; |  68       std::set<const CPDF_Object*>* pVisited) const override; | 
|  69  |  69  | 
|  70   std::vector<CPDF_Object*> m_Objects; |  70   std::vector<CPDF_Object*> m_Objects; | 
|  71 }; |  71 }; | 
 |  72 using UniqueArray = std::unique_ptr<CPDF_Array, ReleaseDeleter<CPDF_Object>>; | 
|  72  |  73  | 
|  73 inline CPDF_Array* ToArray(CPDF_Object* obj) { |  74 inline CPDF_Array* ToArray(CPDF_Object* obj) { | 
|  74   return obj ? obj->AsArray() : nullptr; |  75   return obj ? obj->AsArray() : nullptr; | 
|  75 } |  76 } | 
|  76  |  77  | 
|  77 inline const CPDF_Array* ToArray(const CPDF_Object* obj) { |  78 inline const CPDF_Array* ToArray(const CPDF_Object* obj) { | 
|  78   return obj ? obj->AsArray() : nullptr; |  79   return obj ? obj->AsArray() : nullptr; | 
|  79 } |  80 } | 
|  80  |  81  | 
 |  82 inline UniqueArray ToArray(UniqueObject obj) { | 
 |  83   CPDF_Array* pArray = ToArray(obj.get()); | 
 |  84   if (!pArray) | 
 |  85     return nullptr; | 
 |  86   obj.release(); | 
 |  87   return UniqueArray(pArray); | 
 |  88 } | 
 |  89  | 
|  81 #endif  // CORE_FPDFAPI_PARSER_CPDF_ARRAY_H_ |  90 #endif  // CORE_FPDFAPI_PARSER_CPDF_ARRAY_H_ | 
| OLD | NEW |