]> Creatis software - creaImageIO.git/commitdiff
Try to make it work on Windows, as well.
authorjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Fri, 25 Sep 2009 12:01:51 +0000 (12:01 +0000)
committerjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Fri, 25 Sep 2009 12:01:51 +0000 (12:01 +0000)
src2/creaImageIOGimmick.cpp

index 0e3e4bec68ecb1845709e2bce1d2a83f36350718..09a6fd00685fdd34328f9ef18ae91fd960039354 100644 (file)
@@ -10,8 +10,6 @@
 
 namespace creaImageIO
 {
-
-
   //==============================================================
   Gimmick::Gimmick()
     : mImageAdder(0)
@@ -23,7 +21,6 @@ namespace creaImageIO
   //==============================================================
 
 
-
   //==============================================================
   Gimmick::~Gimmick()
   {
@@ -57,7 +54,6 @@ namespace creaImageIO
 
     mSettings  = new Settings(mCurrentDirectory);
        
-
     std::string dbpath = GetLocalDatabasePath();
     // Create or open local database
     std::string dpath= mCurrentDirectory + "/.gimmick/Shared/gimmick/localdatabase_Descriptor.dscp";
@@ -69,9 +65,7 @@ namespace creaImageIO
     mTreeHandlerMap[i_nameDB] = mLocalDatabase;
     
     //Add additional DB from user Settings
-    addDBSettings();
-
-       
+    addDBSettings();   
   }
 
    ///////////////////////////////////////////////////////////////////////
@@ -131,7 +125,6 @@ namespace creaImageIO
        return sqlTreeH;
   }
 
-
   //==============================================================
   void Gimmick::Finalize()
   {
@@ -199,7 +192,6 @@ namespace creaImageIO
     return mLocalDatabasePath;    
   }
 
-
   //========================================================================
 
   //========================================================================
@@ -237,9 +229,14 @@ namespace creaImageIO
                path=path.substr(0,path.size()-1);
                path=path.substr(0,path.find_last_of("/"));
                //Creating directories
+
+// The following stuff works on Linux, NOT CHECKED on Windows // JPR
                
-               //path+="/bin/Shared/gimmick/localdatabase_Descriptor.dscp";  // JPR
+#if defined(_WIN32)            
+               path+="/bin/Shared/gimmick/localdatabase_Descriptor.dscp";
+#else          
                path+="/Shared/gimmick/localdatabase_Descriptor.dscp";
+#endif         
                std::cout <<"From: " << path   <<std::endl;
                std::cout <<"To: "   << setDir <<std::endl;
                boost::algorithm::replace_all(  path,
@@ -280,8 +277,6 @@ namespace creaImageIO
     return i->second;
   }
 
-
-
   //========================================================================
   /// Add the files to the tree handler
   void Gimmick::AddFiles(const std::string& d, 
@@ -406,12 +401,11 @@ namespace creaImageIO
   }
   //========================================================================
 
-
-  /////////////////////////////////////////////////////////////////////////
-  // add DB from Settings file                                                                              //
-  // @param : -                                                                                                                         //
-  // return : -                                                                                                                         //
-  /////////////////////////////////////////////////////////////////////////
+  ////////////////////////////////////////////////////////////////////////
+  // add DB from Settings file                                         //
+  // @param : -                                                                //
+  // return : -                                                                //
+  ////////////////////////////////////////////////////////////////////////
   void Gimmick::addDBSettings()
   {
 
@@ -438,7 +432,5 @@ namespace creaImageIO
                 std::string name = it_path->substr(pos +1, last_pos -pos-1 );
                 addDB(name, it_path->c_str());
         }
-
-  }
-       
+  }    
 }