|
Field3D
|
Contains the PluginLoader class. More...
Go to the source code of this file.
Classes | |
| class | PluginLoader |
| This class provides methods for loading Field plugins from disk. More... | |
Functions | |
| bool | getDirSos (std::vector< std::string > &sos, std::string &dir) |
Contains the PluginLoader class.
Definition in file PluginLoader.h.
| bool getDirSos | ( | std::vector< std::string > & | sos, |
| std::string & | dir | ||
| ) |
Definition at line 116 of file PluginLoader.cpp.
References filter().
Referenced by PluginLoader::loadPlugins().
{
struct dirent *dirent;
const char *ds = dir.c_str();
DIR *dirfd = opendir(ds);
if (!dirfd) {
std::string er =
"Field3D_plugin loader: could not open directory " + dir + "\n";
//perror(er.c_str());
return false;
}
dirent = readdir(dirfd);
while (dirent != NULL) {
std::string name = dirent->d_name;
if (filter(name)) {
name = dir + "/" + name;
sos.push_back(name);
}
dirent = readdir(dirfd);
}
closedir(dirfd);
return true;
}