From 0cefb3b7853cc7d54d24adfad26b4869dbc44ddc Mon Sep 17 00:00:00 2001 From: Dmitri Naumov <dmitri.naumov@ufz.de> Date: Wed, 27 Nov 2019 15:06:14 +0100 Subject: [PATCH] [BL] Remove unused FileFinder::getPath(). --- BaseLib/FileFinder.cpp | 22 +--------------------- BaseLib/FileFinder.h | 7 ------- 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/BaseLib/FileFinder.cpp b/BaseLib/FileFinder.cpp index c365b0b8fcf..bfcd7ca812a 100644 --- a/BaseLib/FileFinder.cpp +++ b/BaseLib/FileFinder.cpp @@ -52,24 +52,4 @@ void FileFinder::addDirectory(std::string const& dir) _directories.push_back(dir); } } - -std::string FileFinder::getPath(std::string const& filename) const -{ - if (_directories.empty()) - ERR("FileFinder::getPath(): No directories set."); - - for (auto const& dir : _directories) - { - std::string testDir(dir); - std::ifstream is(testDir.append(filename).c_str()); - if (is.good()) - { - is.close(); - return testDir; - } - } - ERR("FileFinder::getPath(): File not found."); - return filename; -} - -} // end namespace BaseLib +} // namespace BaseLib diff --git a/BaseLib/FileFinder.h b/BaseLib/FileFinder.h index 6214f90777c..841085a22ac 100644 --- a/BaseLib/FileFinder.h +++ b/BaseLib/FileFinder.h @@ -45,13 +45,6 @@ public: */ void addDirectory(std::string const& dir); - /** - * Given a filename, this method will return the complete path where this file can be found. - * If the file is located in more than one of the directories in the search list, only the - * first location will be returned. - */ - std::string getPath(std::string const& filename) const; - private: std::vector<std::string> _directories; }; -- GitLab