included libscerror header for throw macros; now honours extension
This commit is contained in:
parent
7ef068fc5b
commit
77c69b721f
@ -14,9 +14,9 @@
|
||||
#include <map>
|
||||
#include <functional>
|
||||
#include <iostream>
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <dirent.h>
|
||||
#include <libscerror.hpp>
|
||||
|
||||
namespace sc {
|
||||
|
||||
@ -32,12 +32,11 @@ namespace sc {
|
||||
std::string plugname {info->d_name};
|
||||
std::string::size_type lastdot = plugname.rfind(".");
|
||||
if (plugname.substr(lastdot + 1) == ext) {
|
||||
|
||||
}
|
||||
plugin plugin {dir + '/' + plugname};
|
||||
plugins.emplace(plugname.substr(0, lastdot), std::move(plugin));
|
||||
}
|
||||
}
|
||||
}
|
||||
throw_if_min1(::closedir(plugins_dir));
|
||||
}
|
||||
|
||||
@ -62,6 +61,7 @@ namespace sc {
|
||||
|
||||
plugin(const std::string& path) : _path {path} {
|
||||
_plugin = ::dlopen(path.c_str(), RTLD_LAZY);
|
||||
|
||||
//std::cerr << path << (_plugin ? "" : " not") << " opened\n";
|
||||
const char* err {::dlerror()};
|
||||
if (err) std::cerr << err << '\n';
|
||||
|
Loading…
x
Reference in New Issue
Block a user