aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2022-06-16 18:45:04 +0200
committerJay Berkenbilt <jberkenbilt@users.noreply.github.com>2022-06-27 18:47:02 +0200
commitf0a8178091dfc87bbf9a6751f8fedf007e8eb144 (patch)
tree9a4b3af6d96a274016f0feecbc5deecb345c5f4f /include
parent5aa8225f493dc3c3171662fecc8a9ff5d0a16feb (diff)
downloadqpdf-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 'include')
-rw-r--r--include/qpdf/QPDFObject.hh2
-rw-r--r--include/qpdf/QPDFObjectHandle.hh2
2 files changed, 3 insertions, 1 deletions
diff --git a/include/qpdf/QPDFObject.hh b/include/qpdf/QPDFObject.hh
index 982cd126..eb7c4b90 100644
--- a/include/qpdf/QPDFObject.hh
+++ b/include/qpdf/QPDFObject.hh
@@ -63,6 +63,7 @@ class QPDFObject
static constexpr object_type_e ot_inlineimage = ::ot_inlineimage;
virtual ~QPDFObject() = default;
+ virtual std::shared_ptr<QPDFObject> shallowCopy() = 0;
virtual std::string unparse() = 0;
virtual JSON getJSON(int json_version) = 0;
@@ -102,6 +103,7 @@ class QPDFObject
releaseResolved()
{
}
+ static std::shared_ptr<QPDFObject> do_create(QPDFObject*);
private:
QPDFObject(QPDFObject const&) = delete;
diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh
index 07e70531..cda257f1 100644
--- a/include/qpdf/QPDFObjectHandle.hh
+++ b/include/qpdf/QPDFObjectHandle.hh
@@ -1551,7 +1551,7 @@ class QPDFObjectHandle
private:
QPDFObjectHandle(QPDF*, int objid, int generation);
- QPDFObjectHandle(QPDFObject*);
+ QPDFObjectHandle(std::shared_ptr<QPDFObject> const&);
enum parser_state_e {
st_top,