comparison Plugins/Engine/PluginsManager.cpp @ 889:d2a393061eb6 plugins

typos
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 14 Jun 2014 20:12:11 +0200
parents d44b845c1c89
children f57802f8b4dc
comparison
equal deleted inserted replaced
888:d44b845c1c89 889:d2a393061eb6
191 191
192 plugins_[name] = plugin.release(); 192 plugins_[name] = plugin.release();
193 } 193 }
194 194
195 195
196 void PluginsManager::ScanFolderForPlugins(const std::string& path, 196 void PluginsManager::ScanFolderForPlugins(const std::string& folder,
197 bool isRecursive) 197 bool isRecursive)
198 { 198 {
199 using namespace boost::filesystem; 199 using namespace boost::filesystem;
200 200
201 if (!exists(path)) 201 if (!exists(folder))
202 { 202 {
203 return; 203 return;
204 } 204 }
205 205
206 LOG(INFO) << "Scanning folder " << path << " for plugins"; 206 LOG(INFO) << "Scanning folder " << folder << " for plugins";
207 207
208 directory_iterator end_it; // default construction yields past-the-end 208 directory_iterator end_it; // default construction yields past-the-end
209 for (directory_iterator it(path); 209 for (directory_iterator it(folder);
210 it != end_it; 210 it != end_it;
211 ++it) 211 ++it)
212 { 212 {
213 std::string path = it->path().string();
214
213 if (is_directory(it->status())) 215 if (is_directory(it->status()))
214 { 216 {
215 if (isRecursive) 217 if (isRecursive)
216 { 218 {
217 ScanFolderForPlugins(it->path().string(), true); 219 ScanFolderForPlugins(path, true);
218 } 220 }
219 } 221 }
220 else 222 else
221 { 223 {
222 if (boost::filesystem::extension(it->path()) == PLUGIN_EXTENSION) 224 if (boost::filesystem::extension(it->path()) == PLUGIN_EXTENSION)
223 { 225 {
224 LOG(INFO) << "Found a shared library: " << it->path(); 226 LOG(INFO) << "Found a shared library: " << it->path();
225 227
226 try 228 try
227 { 229 {
228 SharedLibrary plugin(it->path().string()); 230 SharedLibrary plugin(path);
229 if (IsOrthancPlugin(plugin)) 231 if (IsOrthancPlugin(plugin))
230 { 232 {
231 RegisterPlugin(it->path().string()); 233 RegisterPlugin(path);
232 } 234 }
233 } 235 }
234 catch (OrthancException&) 236 catch (OrthancException&)
235 { 237 {
236 } 238 }