MCPcopy Create free account
hub / github.com/OSVR/OSVR-Core / getAllFilesWithExt

Function getAllFilesWithExt

src/osvr/PluginHost/SearchPath.cpp:77–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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();

Callers 1

loadPluginsMethod · 0.85

Calls 1

push_backMethod · 0.45

Tested by

no test coverage detected