]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkFactory.cxx
#3499 Export to JavaScript
[bbtk.git] / kernel / src / bbtkFactory.cxx
index 820085a430e9a0bcda9a50826ac42982b1bcd74b..368275afb8d5c07af52361ac09576621246b9300 100644 (file)
@@ -145,6 +145,7 @@ namespace bbtk
   
   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
@@ -153,9 +154,7 @@ 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(\""<<name<<"\")"<<std::endl);
                bbtkMessage("debug",1,"Factory::LoadPackage(\""<<name<<"\")"<<std::endl);
@@ -182,7 +181,6 @@ namespace bbtk
 //                     std::cout << (*it).first << " ";
 //             std::cout << std::endl;
 
-               
                if (iUnload != mPackageMap.end())
                {
                  bbtkMessage("output",2,"["<< pkgname <<"] already loaded" << std::endl);
@@ -209,7 +207,7 @@ namespace bbtk
                          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 != "")
@@ -224,24 +222,18 @@ namespace bbtk
                          // 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)
@@ -283,7 +275,6 @@ namespace bbtk
                        }
                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
@@ -666,7 +657,7 @@ namespace bbtk
       } 
     
     bbtkDebugDecTab("kernel",7);
-    return b; 
+    return b;
   }
   //===================================================================