diff options
author | Jay Berkenbilt <ejb@ql.org> | 2022-02-05 14:15:07 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2022-02-05 17:24:56 +0100 |
commit | 5f3f78822b5d43e9b02082da5268d186ba7101c0 (patch) | |
tree | c7d2407df01e4c622371ad290f9681a5ae99a476 /include | |
parent | 88c3d556d552a94aa42eaa2fa43667952e123dc8 (diff) | |
download | qpdf-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')
-rw-r--r-- | include/qpdf/QUtil.hh | 4 |
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. |