X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkFactory.cxx;h=627bc80881b1e99ac4b112dbf8244d543c8a9718;hb=63d56e2f28b834d9e13f3757aaa23ab63b2b3dd6;hp=37563de8e3523386c3d7076837e0d32c0bf15a2c;hpb=664e5cdbbcaf3dafa5fc9f206a7094248c289d5a;p=bbtk.git diff --git a/kernel/src/bbtkFactory.cxx b/kernel/src/bbtkFactory.cxx index 37563de..627bc80 100644 --- a/kernel/src/bbtkFactory.cxx +++ b/kernel/src/bbtkFactory.cxx @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbtkFactory.cxx,v $ Language: C++ - Date: $Date: 2009/06/08 14:50:03 $ - Version: $Revision: 1.45 $ + Date: $Date: 2009/10/05 22:44:48 $ + Version: $Revision: 1.46 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -148,153 +148,158 @@ namespace bbtk // same for Windows, with c:, d: ... // // lastname : string before the last / (if any), or user supplied name + + if(name != ""){ + bbtkDebugMessageInc("kernel",7,"Factory::LoadPackage(\""< package_paths; + std::string libname; // full path library name + std::string pkgname; // e.g. libbb.so + + std::string upath; + pkgname = Utilities::ExtractPackageName(name,upath); + bbtkMessage("debug",1,"Package name ["<0) // ------------------------------------- check user supplied location + { + if (name[0] != '.' && name[0] != '/' && name[1]!= ':') + { + bbtkError("Use absolute or relative path name! ["<::iterator i; + for (i=package_paths.begin();i!=package_paths.end();++i) + { + foundFile = false; + path = *i; +//std::cout<<"JCP bbtkFactory.cxx void Factory::LoadPackage = path "< Trying to load [" << libname << "]" < package_paths; - std::string libname; // full path library name - std::string pkgname; // e.g. libbb.so - - std::string upath; - pkgname = Utilities::ExtractPackageName(name,upath); - - bbtkMessage("debug",1,"Package name ["<0) // ------------------------------------- check user supplied location - { - if (name[0] != '.' && name[0] != '/' && name[1]!= ':') - { - bbtkError("Use absolute or relative path name! ["<::iterator i; - for (i=package_paths.begin();i!=package_paths.end();++i) - { - foundFile = false; - path = *i; - - // we *really* want '.' to be the current working directory - if (path == ".") - { - char buf[2048]; // for getcwd - char * currentDir = getcwd(buf, 2048); - std::string cwd(currentDir); - path = currentDir; - } - - libname = Utilities::MakeLibnameFromPath(path, pkgname); - - bbtkMessage("debug",2,"-> Trying to load [" << libname << "]" <