output metadata about the searched plugin directories if a plugin cannot be found - closes #568
This commit is contained in:
parent
7d8b6bd126
commit
4f9d6e135c
2 changed files with 11 additions and 2 deletions
|
@ -48,8 +48,10 @@ private:
|
|||
static std::map<std::string,boost::shared_ptr<PluginInfo> > plugins_;
|
||||
static bool registered_;
|
||||
static bool insert(const std::string& name,const lt_dlhandle module);
|
||||
static std::vector<std::string> plugin_directories_;
|
||||
public:
|
||||
static std::vector<std::string> plugin_names ();
|
||||
static std::vector<std::string> plugin_names();
|
||||
static std::string plugin_directories();
|
||||
static void register_datasources(const std::string& path);
|
||||
static boost::shared_ptr<datasource> create(parameters const& params);
|
||||
};
|
||||
|
|
|
@ -61,6 +61,7 @@ datasource_cache::~datasource_cache()
|
|||
|
||||
std::map<string,boost::shared_ptr<PluginInfo> > datasource_cache::plugins_;
|
||||
bool datasource_cache::registered_=false;
|
||||
std::vector<std::string> datasource_cache::plugin_directories_;
|
||||
|
||||
datasource_ptr datasource_cache::create(const parameters& params)
|
||||
{
|
||||
|
@ -76,7 +77,7 @@ datasource_ptr datasource_cache::create(const parameters& params)
|
|||
if ( itr == plugins_.end() )
|
||||
{
|
||||
throw config_error(string("Could not create datasource. No plugin ") +
|
||||
"found for type '" + * type + "'");
|
||||
"found for type '" + * type + "' (searched in: " + plugin_directories() + ")");
|
||||
}
|
||||
if ( ! itr->second->handle())
|
||||
{
|
||||
|
@ -114,6 +115,11 @@ bool datasource_cache::insert(const std::string& type,const lt_dlhandle module)
|
|||
(new PluginInfo(type,module)))).second;
|
||||
}
|
||||
|
||||
std::string datasource_cache::plugin_directories()
|
||||
{
|
||||
return boost::algorithm::join(plugin_directories_,", ");
|
||||
}
|
||||
|
||||
std::vector<std::string> datasource_cache::plugin_names ()
|
||||
{
|
||||
std::vector<std::string> names;
|
||||
|
@ -132,6 +138,7 @@ void datasource_cache::register_datasources(const std::string& str)
|
|||
mapnik::CreateStatic>::mutex_);
|
||||
#endif
|
||||
filesystem::path path(str);
|
||||
plugin_directories_.push_back(str);
|
||||
filesystem::directory_iterator end_itr;
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue