Contains the PluginLoader class.
More...
#include <string>
#include <vector>
#include "ns.h"
Go to the source code of this file.
|
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 125 of file PluginLoader.cpp.
References filter().
Referenced by PluginLoader::loadPlugins().
128 const char *ds = dir.c_str();
132 dirh = FindFirstFileA(ds, &fd);
133 while (dirh != INVALID_HANDLE_VALUE)
135 std::string name = fd.cFileName;
136 std::string name_lower;
138 std::transform(name.begin(), name.end(), name_lower.begin(), ::tolower);
140 if (
filter(name_lower,
"so")) {
141 name = dir +
"/" + name;
145 if (!FindNextFileA(dirh, &fd))
152 struct dirent *dirent;
154 const char *ds = dir.c_str();
155 DIR *dirfd = opendir(ds);
158 "Field3D_plugin loader: could not open directory " + dir +
"\n";
163 dirent = readdir(dirfd);
164 while (dirent != NULL) {
166 std::string name = dirent->d_name;
169 name = dir +
"/" + name;
173 dirent = readdir(dirfd);
static int filter(std::string &name, const char *suffix)