2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-05-29 08:20:53 +00:00

Remove redundant methods in QUtil

This was being saved until we had to break ABI.
This commit is contained in:
Jay Berkenbilt 2020-04-03 12:06:23 -04:00
parent da1258e2e6
commit 54726930df
2 changed files with 3 additions and 31 deletions

View File

@ -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<std::string> read_lines_from_file(char const* filename);
// ABI: make preserve_eol an optional arg and remove single-arg version
std::list<std::string> read_lines_from_file(
char const* filename, bool preserve_eol = false);
QPDF_DLL
std::list<std::string> read_lines_from_file(
char const* filename, bool preserve_eol);
QPDF_DLL
std::list<std::string> read_lines_from_file(std::istream&);
// ABI: make preserve_eol an optional arg and remove single-arg version
QPDF_DLL
std::list<std::string> read_lines_from_file(
std::istream&, bool preserve_eol);
std::istream&, bool preserve_eol = false);
QPDF_DLL
std::list<std::string> read_lines_from_file(
FILE*, bool preserve_eol = false);

View File

@ -1059,18 +1059,6 @@ static bool read_char_from_FILE(char& ch, FILE* f)
return true;
}
std::list<std::string>
QUtil::read_lines_from_file(char const* filename)
{
// ABI: remove this method
std::list<std::string> 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<std::string>
QUtil::read_lines_from_file(char const* filename, bool preserve_eol)
{
@ -1082,16 +1070,6 @@ QUtil::read_lines_from_file(char const* filename, bool preserve_eol)
return lines;
}
std::list<std::string>
QUtil::read_lines_from_file(std::istream& in)
{
// ABI: remove this method
std::list<std::string> 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<std::string>
QUtil::read_lines_from_file(std::istream& in, bool preserve_eol)
{