diff --git a/Framework/API/inc/MantidAPI/FileFinder.h b/Framework/API/inc/MantidAPI/FileFinder.h index b83a60068c578b452dc6c970b91c110fd3ce8c9a..594d34c4731ea01a4b7b24eab2d32e3746ecbc7a 100644 --- a/Framework/API/inc/MantidAPI/FileFinder.h +++ b/Framework/API/inc/MantidAPI/FileFinder.h @@ -58,8 +58,6 @@ public: /// DO NOT USE! MADE PUBLIC FOR TESTING ONLY. std::string getExtension(const std::string &filename, const std::vector<std::string> &exts) const; - void getUniqueExtensions(const std::vector<std::string> &exts, - std::set<std::string> &uniqueExts) const; private: friend struct Mantid::Kernel::CreateUsingNew<FileFinderImpl>; @@ -79,6 +77,8 @@ private: const std::set<std::string> &filenames, const std::vector<std::string> &exts) const; std::string toUpper(const std::string &src) const; + void getUniqueExtensions(const std::vector<std::string> &exts, + std::set<std::string> &uniqueExts) const; /// glob option - set to case sensitive or insensitive int m_globOption; }; diff --git a/Framework/API/src/FileFinder.cpp b/Framework/API/src/FileFinder.cpp index aa035053c493bd8d2fca5a1e2b23afb4b4920325..4282d96b536f9c60c176409da865ca584d78b274 100644 --- a/Framework/API/src/FileFinder.cpp +++ b/Framework/API/src/FileFinder.cpp @@ -512,6 +512,14 @@ FileFinderImpl::findRun(const std::string &hintstr, return ""; } +/** + * Given a set of already determined extensions and new extensions, + * create a set of all extensions. + * If not in an extension-is-case-sensitive environment, only add the + * lower case OR upper case version of the extension + * @param exts :: a vector of extensions to add + * @param uniqueExts :: a set of currently included extensions + */ void FileFinderImpl::getUniqueExtensions( const std::vector<std::string> &exts, std::set<std::string> &uniqueExts) const { diff --git a/Framework/API/test/FileFinderTest.h b/Framework/API/test/FileFinderTest.h index 60255b78e7cd760d7e5d81ade178f897b495a5ac..3c9d1979283a6f976e4a67eeee4deb17fc4ce088 100644 --- a/Framework/API/test/FileFinderTest.h +++ b/Framework/API/test/FileFinderTest.h @@ -347,22 +347,6 @@ public: std::cout << "\n end of test \n"; } - void testGetUniqueExtensions() { - std::set<std::string> uniqueExts; - std::vector<std::string> firstExtsToAdd = {".RAW", ".log"}; - std::vector<std::string> secondExtsToAdd = {".so", ".txt", ".RAW"}; - - std::set<std::string> expectedFirstExtensions = {".RAW", ".log"}; - std::set<std::string> expectedSecondExtensions = {".RAW", ".log", ".so", - ".txt"}; - - FileFinder::Instance().getUniqueExtensions(firstExtsToAdd, uniqueExts); - TS_ASSERT_EQUALS(uniqueExts, expectedFirstExtensions); - - FileFinder::Instance().getUniqueExtensions(secondExtsToAdd, uniqueExts); - TS_ASSERT_EQUALS(uniqueExts, expectedSecondExtensions); - } - void testFindAddFiles() { // create a test file to find Poco::File file("LOQ00111-add.raw");