Commit 54726930dffa78f84ab3447cbe464b587694674e

Authored by Jay Berkenbilt
1 parent da1258e2

Remove redundant methods in QUtil

This was being saved until we had to break ABI.
include/qpdf/QUtil.hh
@@ -313,17 +313,11 @@ namespace QUtil @@ -313,17 +313,11 @@ namespace QUtil
313 // Filename is UTF-8 encoded, even on Windows, as described in the 313 // Filename is UTF-8 encoded, even on Windows, as described in the
314 // comments for safe_fopen. 314 // comments for safe_fopen.
315 QPDF_DLL 315 QPDF_DLL
316 - std::list<std::string> read_lines_from_file(char const* filename);  
317 - // ABI: make preserve_eol an optional arg and remove single-arg version  
318 - QPDF_DLL  
319 std::list<std::string> read_lines_from_file( 316 std::list<std::string> read_lines_from_file(
320 - char const* filename, bool preserve_eol);  
321 - QPDF_DLL  
322 - std::list<std::string> read_lines_from_file(std::istream&);  
323 - // ABI: make preserve_eol an optional arg and remove single-arg version 317 + char const* filename, bool preserve_eol = false);
324 QPDF_DLL 318 QPDF_DLL
325 std::list<std::string> read_lines_from_file( 319 std::list<std::string> read_lines_from_file(
326 - std::istream&, bool preserve_eol); 320 + std::istream&, bool preserve_eol = false);
327 QPDF_DLL 321 QPDF_DLL
328 std::list<std::string> read_lines_from_file( 322 std::list<std::string> read_lines_from_file(
329 FILE*, bool preserve_eol = false); 323 FILE*, bool preserve_eol = false);
libqpdf/QUtil.cc
@@ -1060,18 +1060,6 @@ static bool read_char_from_FILE(char&amp; ch, FILE* f) @@ -1060,18 +1060,6 @@ static bool read_char_from_FILE(char&amp; ch, FILE* f)
1060 } 1060 }
1061 1061
1062 std::list<std::string> 1062 std::list<std::string>
1063 -QUtil::read_lines_from_file(char const* filename)  
1064 -{  
1065 - // ABI: remove this method  
1066 - std::list<std::string> lines;  
1067 - FILE* f = safe_fopen(filename, "rb");  
1068 - FileCloser fc(f);  
1069 - auto next_char = [&f](char& ch) { return read_char_from_FILE(ch, f); };  
1070 - read_lines_from_file(next_char, lines, false);  
1071 - return lines;  
1072 -}  
1073 -  
1074 -std::list<std::string>  
1075 QUtil::read_lines_from_file(char const* filename, bool preserve_eol) 1063 QUtil::read_lines_from_file(char const* filename, bool preserve_eol)
1076 { 1064 {
1077 std::list<std::string> lines; 1065 std::list<std::string> lines;
@@ -1083,16 +1071,6 @@ QUtil::read_lines_from_file(char const* filename, bool preserve_eol) @@ -1083,16 +1071,6 @@ QUtil::read_lines_from_file(char const* filename, bool preserve_eol)
1083 } 1071 }
1084 1072
1085 std::list<std::string> 1073 std::list<std::string>
1086 -QUtil::read_lines_from_file(std::istream& in)  
1087 -{  
1088 - // ABI: remove this method  
1089 - std::list<std::string> lines;  
1090 - auto next_char = [&in](char& ch) { return (in.get(ch)) ? true: false; };  
1091 - read_lines_from_file(next_char, lines, false);  
1092 - return lines;  
1093 -}  
1094 -  
1095 -std::list<std::string>  
1096 QUtil::read_lines_from_file(std::istream& in, bool preserve_eol) 1074 QUtil::read_lines_from_file(std::istream& in, bool preserve_eol)
1097 { 1075 {
1098 std::list<std::string> lines; 1076 std::list<std::string> lines;