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

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

Issue 2392603004: Move core/fpdfapi/fpdf_parser to core/fpdfapi/parser (Closed)
Patch Set: Rebase to master 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 | « core/fpdfapi/fpdf_parser/cfdf_document.cpp ('k') | core/fpdfapi/fpdf_parser/cpdf_array.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7 #ifndef CORE_FPDFAPI_FPDF_PARSER_CPDF_ARRAY_H_
8 #define CORE_FPDFAPI_FPDF_PARSER_CPDF_ARRAY_H_
9
10 #include <set>
11 #include <vector>
12
13 #include "core/fpdfapi/fpdf_parser/cpdf_indirect_object_holder.h"
14 #include "core/fpdfapi/fpdf_parser/cpdf_object.h"
15 #include "core/fxcrt/fx_basic.h"
16 #include "core/fxcrt/fx_coordinates.h"
17
18 class CPDF_Array : public CPDF_Object {
19 public:
20 using iterator = std::vector<CPDF_Object*>::iterator;
21 using const_iterator = std::vector<CPDF_Object*>::const_iterator;
22
23 CPDF_Array();
24
25 // CPDF_Object.
26 Type GetType() const override;
27 CPDF_Object* Clone() const override;
28 bool IsArray() const override;
29 CPDF_Array* AsArray() override;
30 const CPDF_Array* AsArray() const override;
31
32 bool IsEmpty() const { return m_Objects.empty(); }
33 size_t GetCount() const { return m_Objects.size(); }
34 CPDF_Object* GetObjectAt(size_t index) const;
35 CPDF_Object* GetDirectObjectAt(size_t index) const;
36 CFX_ByteString GetStringAt(size_t index) const;
37 int GetIntegerAt(size_t index) const;
38 FX_FLOAT GetNumberAt(size_t index) const;
39 CPDF_Dictionary* GetDictAt(size_t index) const;
40 CPDF_Stream* GetStreamAt(size_t index) const;
41 CPDF_Array* GetArrayAt(size_t index) const;
42 FX_FLOAT GetFloatAt(size_t index) const { return GetNumberAt(index); }
43 CFX_Matrix GetMatrix();
44 CFX_FloatRect GetRect();
45
46 void SetAt(size_t index, CPDF_Object* pObj);
47 void InsertAt(size_t index, CPDF_Object* pObj);
48 void RemoveAt(size_t index, size_t nCount = 1);
49
50 void Add(CPDF_Object* pObj);
51 void AddNumber(FX_FLOAT f);
52 void AddInteger(int i);
53 void AddString(const CFX_ByteString& str);
54 void AddName(const CFX_ByteString& str);
55 void AddReference(CPDF_IndirectObjectHolder* pDoc, uint32_t objnum);
56
57 iterator begin() { return m_Objects.begin(); }
58 iterator end() { return m_Objects.end(); }
59 const_iterator begin() const { return m_Objects.begin(); }
60 const_iterator end() const { return m_Objects.end(); }
61
62 protected:
63 ~CPDF_Array() override;
64
65 CPDF_Object* CloneNonCyclic(
66 bool bDirect,
67 std::set<const CPDF_Object*>* pVisited) const override;
68
69 std::vector<CPDF_Object*> m_Objects;
70 };
71
72 #endif // CORE_FPDFAPI_FPDF_PARSER_CPDF_ARRAY_H_
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_parser/cfdf_document.cpp ('k') | core/fpdfapi/fpdf_parser/cpdf_array.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698