From 54726930dffa78f84ab3447cbe464b587694674e Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Fri, 3 Apr 2020 12:06:23 -0400 Subject: [PATCH] Remove redundant methods in QUtil --- include/qpdf/QUtil.hh | 10 ++-------- libqpdf/QUtil.cc | 22 ---------------------- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/include/qpdf/QUtil.hh b/include/qpdf/QUtil.hh index e44f95a..fa6a76a 100644 --- a/include/qpdf/QUtil.hh +++ b/include/qpdf/QUtil.hh @@ -313,17 +313,11 @@ namespace QUtil // Filename is UTF-8 encoded, even on Windows, as described in the // comments for safe_fopen. QPDF_DLL - std::list read_lines_from_file(char const* filename); - // ABI: make preserve_eol an optional arg and remove single-arg version - QPDF_DLL std::list read_lines_from_file( - char const* filename, bool preserve_eol); - QPDF_DLL - std::list read_lines_from_file(std::istream&); - // ABI: make preserve_eol an optional arg and remove single-arg version + char const* filename, bool preserve_eol = false); QPDF_DLL std::list read_lines_from_file( - std::istream&, bool preserve_eol); + std::istream&, bool preserve_eol = false); QPDF_DLL std::list read_lines_from_file( FILE*, bool preserve_eol = false); diff --git a/libqpdf/QUtil.cc b/libqpdf/QUtil.cc index 5c4bdee..04aaf51 100644 --- a/libqpdf/QUtil.cc +++ b/libqpdf/QUtil.cc @@ -1060,18 +1060,6 @@ static bool read_char_from_FILE(char& ch, FILE* f) } std::list -QUtil::read_lines_from_file(char const* filename) -{ - // ABI: remove this method - std::list lines; - FILE* f = safe_fopen(filename, "rb"); - FileCloser fc(f); - auto next_char = [&f](char& ch) { return read_char_from_FILE(ch, f); }; - read_lines_from_file(next_char, lines, false); - return lines; -} - -std::list QUtil::read_lines_from_file(char const* filename, bool preserve_eol) { std::list lines; @@ -1083,16 +1071,6 @@ QUtil::read_lines_from_file(char const* filename, bool preserve_eol) } std::list -QUtil::read_lines_from_file(std::istream& in) -{ - // ABI: remove this method - std::list lines; - auto next_char = [&in](char& ch) { return (in.get(ch)) ? true: false; }; - read_lines_from_file(next_char, lines, false); - return lines; -} - -std::list QUtil::read_lines_from_file(std::istream& in, bool preserve_eol) { std::list lines; -- libgit2 0.21.4