diff --git a/include/storage/io.hpp b/include/storage/io.hpp index dfdb382db..00a3ab2e5 100644 --- a/include/storage/io.hpp +++ b/include/storage/io.hpp @@ -27,16 +27,6 @@ namespace io class FileReader { public: - class LineWrapper : public std::string - { - friend std::istream &operator>>(std::istream &is, LineWrapper &line) - { - return std::getline(is, line); - } - }; - auto GetLineIteratorBegin() { return std::istream_iterator(input_stream); } - auto GetLineIteratorEnd() { return std::istream_iterator(); } - enum FingerprintFlag { VerifyFingerprint, diff --git a/unit_tests/util/io.cpp b/unit_tests/util/io.cpp index e14f960e0..58a11abaa 100644 --- a/unit_tests/util/io.cpp +++ b/unit_tests/util/io.cpp @@ -159,30 +159,4 @@ BOOST_AUTO_TEST_CASE(io_incompatible_fingerprint) } } -BOOST_AUTO_TEST_CASE(io_read_lines) -{ - { - std::ofstream f(IO_TEXT_FILE, std::ios::binary); - char str[] = "A\nB\nC\nD"; - f.write(str, strlen(str)); - } - { - osrm::storage::io::FileReader infile(IO_TEXT_FILE, - osrm::storage::io::FileReader::HasNoFingerprint); - auto startiter = infile.GetLineIteratorBegin(); - auto enditer = infile.GetLineIteratorEnd(); - std::vector resultlines; - while (startiter != enditer) - { - resultlines.push_back(*startiter); - ++startiter; - } - BOOST_REQUIRE_MESSAGE(resultlines.size() == 4, "Expected 4 lines of text"); - BOOST_REQUIRE_MESSAGE(resultlines[0] == "A", "Expected the first line to be A"); - BOOST_REQUIRE_MESSAGE(resultlines[1] == "B", "Expected the first line to be B"); - BOOST_REQUIRE_MESSAGE(resultlines[2] == "C", "Expected the first line to be C"); - BOOST_REQUIRE_MESSAGE(resultlines[3] == "D", "Expected the first line to be D"); - } -} - BOOST_AUTO_TEST_SUITE_END()