------------------------------------------------------------------------
| 254 | |
| 255 | //------------------------------------------------------------------------ |
| 256 | Module::Ptr Module::create (const std::string& path, std::string& errorDescription) |
| 257 | { |
| 258 | auto _module = std::make_shared<LinuxModule> (); |
| 259 | if (_module->load (path, errorDescription)) |
| 260 | { |
| 261 | auto it = std::find_if (path.rbegin (), path.rend (), |
| 262 | [] (const std::string::value_type& c) { return c == '/'; }); |
| 263 | _module->path = path; |
| 264 | if (it != path.rend ()) |
| 265 | _module->name = {it.base (), path.end ()}; |
| 266 | return _module; |
| 267 | } |
| 268 | return nullptr; |
| 269 | } |
| 270 | |
| 271 | //------------------------------------------------------------------------ |
| 272 | Module::PathList Module::getModulePaths () |