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

Side by Side Diff: core/fpdfapi/fpdf_parser/include/cpdf_array.h

Issue 2001783003: Get rid of CPDF_Object::GetArray(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 4 years, 7 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
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_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 <vector> 10 #include <vector>
11 11
12 #include "core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h" 12 #include "core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h"
13 #include "core/fpdfapi/fpdf_parser/include/cpdf_object.h" 13 #include "core/fpdfapi/fpdf_parser/include/cpdf_object.h"
14 #include "core/fxcrt/include/fx_basic.h" 14 #include "core/fxcrt/include/fx_basic.h"
15 #include "core/fxcrt/include/fx_coordinates.h" 15 #include "core/fxcrt/include/fx_coordinates.h"
16 16
17 class CPDF_Array : public CPDF_Object { 17 class CPDF_Array : public CPDF_Object {
18 public: 18 public:
19 using iterator = std::vector<CPDF_Object*>::iterator; 19 using iterator = std::vector<CPDF_Object*>::iterator;
20 using const_iterator = std::vector<CPDF_Object*>::const_iterator; 20 using const_iterator = std::vector<CPDF_Object*>::const_iterator;
21 21
22 CPDF_Array(); 22 CPDF_Array();
23 23
24 // CPDF_Object. 24 // CPDF_Object.
25 Type GetType() const override; 25 Type GetType() const override;
26 CPDF_Object* Clone(FX_BOOL bDirect = FALSE) const override; 26 CPDF_Object* Clone(FX_BOOL bDirect = FALSE) const override;
27 CPDF_Array* GetArray() const override;
28 bool IsArray() const override; 27 bool IsArray() const override;
29 CPDF_Array* AsArray() override; 28 CPDF_Array* AsArray() override;
30 const CPDF_Array* AsArray() const override; 29 const CPDF_Array* AsArray() const override;
31 30
32 size_t GetCount() const { return m_Objects.size(); } 31 size_t GetCount() const { return m_Objects.size(); }
33 CPDF_Object* GetObjectAt(size_t index) const; 32 CPDF_Object* GetObjectAt(size_t index) const;
34 CPDF_Object* GetDirectObjectAt(size_t index) const; 33 CPDF_Object* GetDirectObjectAt(size_t index) const;
35 CFX_ByteString GetStringAt(size_t index) const; 34 CFX_ByteString GetStringAt(size_t index) const;
36 int GetIntegerAt(size_t index) const; 35 int GetIntegerAt(size_t index) const;
37 FX_FLOAT GetNumberAt(size_t index) const; 36 FX_FLOAT GetNumberAt(size_t index) const;
(...skipping 27 matching lines...) Expand all
65 const_iterator begin() const { return m_Objects.begin(); } 64 const_iterator begin() const { return m_Objects.begin(); }
66 const_iterator end() const { return m_Objects.end(); } 65 const_iterator end() const { return m_Objects.end(); }
67 66
68 protected: 67 protected:
69 ~CPDF_Array() override; 68 ~CPDF_Array() override;
70 69
71 std::vector<CPDF_Object*> m_Objects; 70 std::vector<CPDF_Object*> m_Objects;
72 }; 71 };
73 72
74 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_ARRAY_H_ 73 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_ARRAY_H_
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp ('k') | core/fpdfapi/fpdf_parser/include/cpdf_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698