void Factory::LoadPackage( const std::string& name )
{
+
// Note : in the following :
// name : the user supplied name
// - abreviated name e.g. pkg pkg.so libbpkg libbbpkg.so
// same for Windows, with c:, d: ...
//
// lastname : string before the last / (if any), or user supplied name
-
-
-
+
if(name != ""){
bbtkDebugMessageInc("kernel",7,"Factory::LoadPackage(\""<<name<<"\")"<<std::endl);
bbtkMessage("debug",1,"Factory::LoadPackage(\""<<name<<"\")"<<std::endl);
// std::cout << (*it).first << " ";
// std::cout << std::endl;
-
if (iUnload != mPackageMap.end())
{
bbtkMessage("output",2,"["<< pkgname <<"] already loaded" << std::endl);
return;
}
- // std::string path = Utilities::ExpandLibName(upath, false);
+ // std::string path = Utilities::ExpandLibName(upath, false);
std::string path = Utilities::ExpandLibName(name,false); // keep last item, here.
if (path != "")
// The following is *NOT* a debug time message :
// It's a user intended message.
// Please don't remove it.
- bbtkMessage("output",3," [" <<libname
- <<"] : doesn't exist" <<std::endl);
- }
- else
- {
+ bbtkMessage("output",3," [" << libname <<"] : doesn't exist" <<std::endl);
+ } else {
ok = DoLoadPackage( libname, pkgname, path);
- }
- }
- else
- {
+ }
+ } else {
bbtkError("Path ["<<upath<<"] doesn't exist");
return;
}
- }
- else // ----------------------------------------------------- iterate on the paths
+ } else // ----------------------------------------------------- iterate on the paths
{
- std::string path = ".";
+ std::string path = ".";
package_paths = ConfigurationFile::GetInstance().Get_package_paths();
std::vector<std::string>::iterator i;
for (i=package_paths.begin();i!=package_paths.end();++i)
}
break; // we stop iterating even if error : have to signal it to user
} //------------------ // end for ( package_paths.begin();i!=package_paths.end() )
-
}
if( !ok ) // nothing was loaded
}
bbtkDebugDecTab("kernel",7);
- return b;
+ return b;
}
//===================================================================