aboutsummaryrefslogtreecommitdiffstats
path: root/include/qpdf/QUtil.hh
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2019-06-22 16:12:10 +0200
committerJay Berkenbilt <ejb@ql.org>2019-06-22 16:14:25 +0200
commit1bde5c68a302c99c627f86d8c95226a8a7623ac3 (patch)
treea29bbd128894dd564375ecef0917da310ef1ee6d /include/qpdf/QUtil.hh
parent658b5bb3be49d2666b91d35671de71c1cf0a5853 (diff)
downloadqpdf-1bde5c68a302c99c627f86d8c95226a8a7623ac3.tar.zst
Add QUtil::read_file_into_memory
This code was essentially duplicated between test_driver and standalone_fuzz_target_runner.
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 9f76f738..a0442f69 100644
--- a/include/qpdf/QUtil.hh
+++ b/include/qpdf/QUtil.hh
@@ -24,6 +24,7 @@
#include <qpdf/DLL.h>
#include <qpdf/Types.h>
+#include <qpdf/PointerHolder.hh>
#include <string>
#include <list>
#include <vector>
@@ -304,6 +305,9 @@ namespace QUtil
std::list<std::string> read_lines_from_file(char const* filename);
QPDF_DLL
std::list<std::string> read_lines_from_file(std::istream&);
+ QPDF_DLL
+ void read_file_into_memory(
+ char const* filename, PointerHolder<char>& file_buf, size_t& size);
// This used to be called strcasecmp, but that is a macro on some
// platforms, so we have to give it a name that is not likely to