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

Unified Diff: core/include/fpdfapi/cpdf_array.h

Issue 1776913007: Split fpdf_parser_objects.cpp into per-class .cpp/.h files. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Address comments Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/include/fpdfapi/cfdf_document.h ('k') | core/include/fpdfapi/cpdf_boolean.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/include/fpdfapi/cpdf_array.h
diff --git a/core/include/fpdfapi/cpdf_array.h b/core/include/fpdfapi/cpdf_array.h
new file mode 100644
index 0000000000000000000000000000000000000000..8e47d9fef59e5c6a3691feae886ac4e0f8a7fcab
--- /dev/null
+++ b/core/include/fpdfapi/cpdf_array.h
@@ -0,0 +1,65 @@
+// Copyright 2016 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef CORE_INCLUDE_FPDFAPI_CPDF_ARRAY_H_
+#define CORE_INCLUDE_FPDFAPI_CPDF_ARRAY_H_
+
+#include "core/include/fpdfapi/cpdf_indirect_object_holder.h"
+#include "core/include/fpdfapi/cpdf_object.h"
+#include "core/include/fxcrt/fx_basic.h"
+#include "core/include/fxcrt/fx_coordinates.h"
+
+class CPDF_Array : public CPDF_Object {
+ public:
+ CPDF_Array();
+
+ // CPDF_Object.
+ Type GetType() const override;
+ CPDF_Object* Clone(FX_BOOL bDirect = FALSE) const override;
+ CPDF_Array* GetArray() const override;
+ bool IsArray() const override;
+ CPDF_Array* AsArray() override;
+ const CPDF_Array* AsArray() const override;
+
+ FX_DWORD GetCount() const { return m_Objects.GetSize(); }
+ CPDF_Object* GetElement(FX_DWORD index) const;
+ CPDF_Object* GetElementValue(FX_DWORD index) const;
+ CFX_Matrix GetMatrix();
+ CFX_FloatRect GetRect();
+ CFX_ByteString GetStringAt(FX_DWORD index) const;
+ CFX_ByteStringC GetConstStringAt(FX_DWORD index) const;
+ int GetIntegerAt(FX_DWORD index) const;
+ FX_FLOAT GetNumberAt(FX_DWORD index) const;
+ CPDF_Dictionary* GetDictAt(FX_DWORD index) const;
+ CPDF_Stream* GetStreamAt(FX_DWORD index) const;
+ CPDF_Array* GetArrayAt(FX_DWORD index) const;
+ FX_FLOAT GetFloatAt(FX_DWORD index) const { return GetNumberAt(index); }
+
+ void SetAt(FX_DWORD index,
+ CPDF_Object* pObj,
+ CPDF_IndirectObjectHolder* pObjs = nullptr);
+ void InsertAt(FX_DWORD index,
+ CPDF_Object* pObj,
+ CPDF_IndirectObjectHolder* pObjs = nullptr);
+ void RemoveAt(FX_DWORD index, int nCount = 1);
+
+ void Add(CPDF_Object* pObj, CPDF_IndirectObjectHolder* pObjs = nullptr);
+ void AddNumber(FX_FLOAT f);
+ void AddInteger(int i);
+ void AddString(const CFX_ByteString& str);
+ void AddName(const CFX_ByteString& str);
+ void AddReference(CPDF_IndirectObjectHolder* pDoc, FX_DWORD objnum);
+ void AddReference(CPDF_IndirectObjectHolder* pDoc, CPDF_Object* obj) {
+ AddReference(pDoc, obj->GetObjNum());
+ }
+
+ protected:
+ ~CPDF_Array() override;
+
+ CFX_ArrayTemplate<CPDF_Object*> m_Objects;
+};
+
+#endif // CORE_INCLUDE_FPDFAPI_CPDF_ARRAY_H_
« no previous file with comments | « core/include/fpdfapi/cfdf_document.h ('k') | core/include/fpdfapi/cpdf_boolean.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698