aboutsummaryrefslogtreecommitdiffstats
path: root/include/qpdf/QUtil.hh
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-02-05 14:15:07 +0100
committerJay Berkenbilt <ejb@ql.org>2022-02-05 17:24:56 +0100
commit5f3f78822b5d43e9b02082da5268d186ba7101c0 (patch)
treec7d2407df01e4c622371ad290f9681a5ae99a476 /include/qpdf/QUtil.hh
parent88c3d556d552a94aa42eaa2fa43667952e123dc8 (diff)
downloadqpdf-5f3f78822b5d43e9b02082da5268d186ba7101c0.tar.zst
Improve use of std::unique_ptr
* Use unique_ptr in place of shared_ptr in some cases * unique_ptr for arrays does not require a custom deleter * use std::make_unique (c++14) where possible
Diffstat (limited to 'include/qpdf/QUtil.hh')
-rw-r--r--include/qpdf/QUtil.hh4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/qpdf/QUtil.hh b/include/qpdf/QUtil.hh
index 6ff90c45..927fc1d8 100644
--- a/include/qpdf/QUtil.hh
+++ b/include/qpdf/QUtil.hh
@@ -161,6 +161,10 @@ namespace QUtil
QPDF_DLL
std::shared_ptr<char> make_shared_cstr(std::string const&);
+ // Copy string as a unique_ptr to an array.
+ QPDF_DLL
+ std::unique_ptr<char[]> make_unique_cstr(std::string const&);
+
// Returns lower-case hex-encoded version of the string, treating
// each character in the input string as unsigned. The output
// string will be twice as long as the input string.