try to dlopen any file in datasources dir
This commit is contained in:
parent
2a4f25706b
commit
e9fff475be
1 changed files with 14 additions and 24 deletions
|
@ -98,30 +98,20 @@ namespace mapnik
|
||||||
if (!is_directory( *itr ))
|
if (!is_directory( *itr ))
|
||||||
{
|
{
|
||||||
std::string file_name(str+"/"+itr->leaf());
|
std::string file_name(str+"/"+itr->leaf());
|
||||||
|
lt_dlhandle module=lt_dlopenext(file_name.c_str());
|
||||||
if (file_name=="." || file_name=="..")
|
if (module)
|
||||||
continue;
|
{
|
||||||
std::string::size_type len=file_name.size();
|
datasource_name* ds_name = (datasource_name*) lt_dlsym(module, "datasource_name");
|
||||||
|
if (ds_name && insert(ds_name(),module))
|
||||||
if (len>3 &&
|
{
|
||||||
file_name[len-1]=='o' &&
|
std::cout<<"registered datasource : "<<ds_name()<<std::endl;
|
||||||
file_name[len-2]=='s')
|
registered_=true;
|
||||||
{
|
}
|
||||||
lt_dlhandle module=lt_dlopenext(file_name.c_str());
|
}
|
||||||
if (module)
|
else
|
||||||
{
|
{
|
||||||
datasource_name* ds_name = (datasource_name*) lt_dlsym(module, "datasource_name");
|
std::cerr<<lt_dlerror()<<std::endl;
|
||||||
if (ds_name && insert(ds_name(),module))
|
}
|
||||||
{
|
|
||||||
std::cout<<"registered datasource : "<<ds_name()<<std::endl;
|
|
||||||
registered_=true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::cerr<<lt_dlerror()<<std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue