diff options
author | Jay Berkenbilt <ejb@ql.org> | 2019-06-22 16:12:10 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2019-06-22 16:14:25 +0200 |
commit | 1bde5c68a302c99c627f86d8c95226a8a7623ac3 (patch) | |
tree | a29bbd128894dd564375ecef0917da310ef1ee6d /include | |
parent | 658b5bb3be49d2666b91d35671de71c1cf0a5853 (diff) | |
download | qpdf-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')
-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 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 |