| 75 | } |
| 76 | |
| 77 | FileList getAllFilesWithExt(SearchPath dirPath, const std::string &ext) { |
| 78 | FileList filesPaths; |
| 79 | |
| 80 | for (const auto &path : dirPath) { |
| 81 | using boost::filesystem::directory_iterator; |
| 82 | using boost::make_iterator_range; |
| 83 | boost::filesystem::path directoryPath(path); |
| 84 | |
| 85 | // Make sure that directory exists |
| 86 | if (!boost::filesystem::exists(directoryPath)) { |
| 87 | continue; |
| 88 | } |
| 89 | |
| 90 | // Get a list of files inside the dir that match the extension |
| 91 | for (const auto &pathName : make_iterator_range( |
| 92 | directory_iterator(directoryPath), directory_iterator())) { |
| 93 | if (!boost::filesystem::is_regular_file(pathName) || |
| 94 | pathName.path().extension() != ext) |
| 95 | continue; |
| 96 | |
| 97 | filesPaths.push_back(pathName.path().generic_string()); |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | return filesPaths; |
| 102 | } |
| 103 | |
| 104 | std::string findPlugin(const std::string &pluginName) { |
| 105 | auto searchPaths = getPluginSearchPath(); |