diff options
author | m-holger <m-holger@kubitscheck.org> | 2022-06-16 18:45:04 +0200 |
---|---|---|
committer | Jay Berkenbilt <jberkenbilt@users.noreply.github.com> | 2022-06-27 18:47:02 +0200 |
commit | f0a8178091dfc87bbf9a6751f8fedf007e8eb144 (patch) | |
tree | 9a4b3af6d96a274016f0feecbc5deecb345c5f4f /libqpdf/qpdf/QPDF_Array.hh | |
parent | 5aa8225f493dc3c3171662fecc8a9ff5d0a16feb (diff) | |
download | qpdf-f0a8178091dfc87bbf9a6751f8fedf007e8eb144.tar.zst |
Refactor QPDFObject creation and cloning
Move responsibility for creating shared pointers to objects and cloning from QPDFObjectHandle to QPDFObject.
Diffstat (limited to 'libqpdf/qpdf/QPDF_Array.hh')
-rw-r--r-- | libqpdf/qpdf/QPDF_Array.hh | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libqpdf/qpdf/QPDF_Array.hh b/libqpdf/qpdf/QPDF_Array.hh index ac5d98be..e718c6e0 100644 --- a/libqpdf/qpdf/QPDF_Array.hh +++ b/libqpdf/qpdf/QPDF_Array.hh @@ -10,9 +10,10 @@ class QPDF_Array: public QPDFObject { public: - QPDF_Array(std::vector<QPDFObjectHandle> const& items); - QPDF_Array(SparseOHArray const& items); virtual ~QPDF_Array() = default; + static std::shared_ptr<QPDFObject> create(std::vector<QPDFObjectHandle> const& items); + static std::shared_ptr<QPDFObject> create(SparseOHArray const& items); + virtual std::shared_ptr<QPDFObject> shallowCopy(); virtual std::string unparse(); virtual JSON getJSON(int json_version); virtual QPDFObject::object_type_e getTypeCode() const; @@ -31,13 +32,14 @@ class QPDF_Array: public QPDFObject // Helper methods for QPDF and QPDFObjectHandle -- these are // public methods since the whole class is not part of the public // API. Otherwise, these would be wrapped in accessor classes. - SparseOHArray const& getElementsForShallowCopy() const; void addExplicitElementsToList(std::list<QPDFObjectHandle>&) const; protected: virtual void releaseResolved(); private: + QPDF_Array(std::vector<QPDFObjectHandle> const& items); + QPDF_Array(SparseOHArray const& items); SparseOHArray elements; }; |