aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/qpdf/QPDF_String.hh
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 /libqpdf/qpdf/QPDF_String.hh
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 'libqpdf/qpdf/QPDF_String.hh')
-rw-r--r--libqpdf/qpdf/QPDF_String.hh8
1 files changed, 6 insertions, 2 deletions
diff --git a/libqpdf/qpdf/QPDF_String.hh b/libqpdf/qpdf/QPDF_String.hh
index 6fd1b0e9..fc11d3ba 100644
--- a/libqpdf/qpdf/QPDF_String.hh
+++ b/libqpdf/qpdf/QPDF_String.hh
@@ -7,10 +7,13 @@
class QPDF_String: public QPDFObject
{
+ friend class QPDFWriter;
+
public:
- QPDF_String(std::string const& val);
- static QPDF_String* new_utf16(std::string const& utf8_val);
virtual ~QPDF_String() = default;
+ static std::shared_ptr<QPDFObject> create(std::string const& val);
+ static std::shared_ptr<QPDFObject> create_utf16(std::string const& utf8_val);
+ virtual std::shared_ptr<QPDFObject> shallowCopy();
virtual std::string unparse();
virtual QPDFObject::object_type_e getTypeCode() const;
virtual char const* getTypeName() const;
@@ -20,6 +23,7 @@ class QPDF_String: public QPDFObject
std::string getUTF8Val() const;
private:
+ QPDF_String(std::string const& val);
bool useHexString() const;
std::string val;
};