]> Creatis software - creaImageIO.git/commitdiff
Bug 1805:
authorfcervenansky <frederic.cervenansky@creatis.insa-lyon.fr>
Thu, 22 Nov 2012 15:02:22 +0000 (16:02 +0100)
committerfcervenansky <frederic.cervenansky@creatis.insa-lyon.fr>
Thu, 22 Nov 2012 15:02:22 +0000 (16:02 +0100)
modifications for boost filesystem

CMakeLists.txt
src/creaImageIODicomImageReader2.cpp
src/creaImageIODicomScanner.cpp
src/creaImageIOSimpleView.cpp
src/creaImageIOTreeHandlerImageAdder.cpp
src/creaImageIOUltrasonixImageReader.cpp
src/creaImageIOVtkImageReader.cpp
src/creaImageIOWxAnySimpleDlg.cpp
src/creaImageIOWxGimmickView.cpp

index d2c85ad79d00d6a9b0c1e11e804e76c9a531d743..4b46d8dd455b329e2fbad820186f97403863c997 100644 (file)
@@ -64,7 +64,7 @@ CREA_PREVENT_IN_SOURCE_BUILD()
 
 
 # For boost 1.46 troubles...  // JPR.
-add_definitions(-DBOOST_FILESYSTEM_VERSION=2)
+add_definitions(-DBOOST_FILESYSTEM_VERSION=3)
 
 SET(USE_GDCM_VTK ON)
 
index 5e8b5705c75bc68538fb4a5d3818520cb6a8649a..aa67c76da8ddf28da92912465e74c3e4ed9eb9cd 100644 (file)
@@ -172,7 +172,7 @@ namespace creaImageIO
                          if ( i->first == "D0004_1500" )
                          {
                                  boost::filesystem::path full_path(filename);
-                                 std::string f = full_path.leaf();
+                                 std::string f = full_path.leaf().string();
                                  i->second = f;
                          }
                          else if ( i->first == "FullFileName" )
@@ -245,7 +245,7 @@ void DicomImageReader::ReadAttributes2(const std::string& filename,
                        if ( i->first == "D0004_1500" )
                        {
                                boost::filesystem::path full_path(filename);
-                               std::string f = full_path.leaf();
+                               std::string f = full_path.leaf().string();
                                i->second = f;
                        }
                        else if ( i->first == "FullFileName" )
index 7b1b0b7d4cadfd5ec603aacb43072412ff0e3217..8e71e83e9bee22de08fc2a5698a80ab41ba9598c 100644 (file)
@@ -176,7 +176,7 @@ void DicomImageScanner::ReadAttributes(const std::string& filename,
                        if ( attr.find("D0004_1500") != attr.end())
                        {
                                boost::filesystem::path full_path(filename);
-                               std::string f = full_path.leaf();
+                               std::string f = full_path.leaf().string();
                                attr["D0004_1500"] = f;
                        }
                        if ( attr.find("FullFileName")!= attr.end())
index 7d6a48510aed9a3b8a2b3636196123cbd59cd072..d44f941c60316be8d9520f0757806f4700329139 100644 (file)
@@ -67,9 +67,9 @@ namespace creaImageIO
                                {
                                        if (!boost::filesystem::is_directory(itr->status()))
                                        {
-                                               if( mReader->CanRead(itr->string()) )
+                                               if( mReader->CanRead(itr->path().string()) )
                                                {
-                                                       names.push_back(itr->string()); 
+                                                       names.push_back(itr->path().string()); 
                                                }
                                        }
                                }
index 33f6dd80a42b991ba66d0263f54dd4c302c3a052..ff4683d13d61c012832e617ae3bcb3135e4948d1 100644 (file)
@@ -239,20 +239,20 @@ namespace creaImageIO
          {
            if (recursive) 
                {
-                       AddDirectoryRecursorScanner( itr->string(), recursive, addKey, i_sc, true);
+                       AddDirectoryRecursorScanner( itr->path().string(), recursive, addKey, i_sc, true);
                }
          }
        else 
          {
                std::string parent_id;
                // tTest if directory (and only it) exists or not.
-               bool valid = mSynchronizer->isIndexed(itr->string());//true;//=mTimestampHandler->AddDirectory(dirpath, itr->string(), lastModif, time(0),mCurrentDB);
+               bool valid = mSynchronizer->isIndexed(itr->path().string());//true;//=mTimestampHandler->AddDirectory(dirpath, itr->string(), lastModif, time(0),mCurrentDB);
                if(valid)
                {
-                       std::string path(itr->string());
+                       std::string path(itr->path().string());
                        mProgress.IncNumberScannedFiles();
                         boost::algorithm::replace_all( path,INVALID_FILE_SEPARATOR,VALID_FILE_SEPARATOR);
-                       i_sc.ReadAttributes(itr->string(),attr);
+                       i_sc.ReadAttributes(itr->path().string(),attr);
                //      mTreeHandler->GetTopLevelNodeId("FullFileName",itr->string(),parent_id);
                        mTreeHandler->AddBranch(attr);
                        mProgress.IncNumberHandledFiles();
@@ -296,25 +296,25 @@ namespace creaImageIO
          {
            if (recursive) 
                {
-                       AddDirectoryRecursor( itr->string(), recursive, addKey);
+                       AddDirectoryRecursor( itr->path().string(), recursive, addKey);
                }
          }
        else 
          {
                std::string parent_id;
                // tTest if directory (and only it) exists or not.
-               bool valid = mSynchronizer->isIndexed(itr->string());//true;//=mTimestampHandler->AddDirectory(dirpath, itr->string(), lastModif, time(0),mCurrentDB);
+               bool valid = mSynchronizer->isIndexed(itr->path().string());//true;//=mTimestampHandler->AddDirectory(dirpath, itr->string(), lastModif, time(0),mCurrentDB);
                if(valid)
                {
                        mProgress.IncNumberScannedFiles();
-                       if (IsHandledFile(itr->string()))
+                       if (IsHandledFile(itr->path().string()))
                        {
                        mProgress.IncNumberHandledFiles();
-                       AddFile( itr->string() );
+                       AddFile( itr->path().string() );
                        //mTreeHandler->GetTopLevelNodeId("FullFileName",itr->string(),parent_id);
                        std::stringstream removedOn;
                        removedOn<<time(0);
-                       mSynchronizer->InsertIgnoreFile(addKey, itr->string(),"0",removedOn.str(),mCurrentDB);
+                       mSynchronizer->InsertIgnoreFile(addKey, itr->path().string(),"0",removedOn.str(),mCurrentDB);
                        }
                        
                        mProgressSignal(mProgress);
@@ -352,17 +352,17 @@ namespace creaImageIO
         {
             if (recursive)
                        {
-                CheckSyncDirectory( itr->string(), recursive, repair, checkAttributes, i_ignorefiles, attsModified, newfiles);
+                CheckSyncDirectory( itr->path().string(), recursive, repair, checkAttributes, i_ignorefiles, attsModified, newfiles);
                        }
         }
         else
         {
-            if (IsHandledFile(itr->string()))
+            if (IsHandledFile(itr->path().string()))
             {
                 bool bfound = false;
                 for(std::vector<std::string>::iterator it_new = i_ignorefiles.begin(); it_new < i_ignorefiles.end(); ++it_new)
                 {
-                                       if((*it_new) == itr->string())
+                                       if((*it_new) == itr->path().string())
                     {
                         bfound = true;
                                                //Additional checking of attributes
@@ -376,7 +376,7 @@ namespace creaImageIO
                                }
                                if(!bfound && i_ignorefiles.size()>0 )
                 {
-                    newfiles.push_back( itr->string() );
+                    newfiles.push_back( itr->path().string() );
                 }
                        }
                }
index d5f6c655240da2f5f2b00acd13961719673bc324..4116bb7866e141fcaab14c74d7eb8ee1ce9ebade 100644 (file)
@@ -261,7 +261,7 @@ namespace creaImageIO
     if ( (i = attr.find("D0004_1500")) != attr.end())
     {
           boost::filesystem::path full_path(filename);
-          std::string f = full_path.leaf();
+          std::string f = full_path.leaf().string();
           i->second = f;
     }
     if ( (i = attr.find("D0028_0010")) != attr.end())
index e2b7eb29d976c96a0a89a030d8ed0f988977cd04..9cf160b0634f0c6da5475d4c86a100540e3aeadb 100644 (file)
@@ -175,7 +175,7 @@ namespace creaImageIO{
     if ( (i = attr.find("D0004_1500")) != attr.end())
       {
        boost::filesystem::path full_path(filename);
-       std::string f = full_path.leaf();
+       std::string f = full_path.leaf().string();
        i->second = f;
       }
     if ( (i = attr.find("D0028_0010")) != attr.end())
index 7a1609d825235e5f9cedf678186ba48886f08572..926e1181675271f373a4e08021c5670b1fa536a3 100644 (file)
@@ -141,7 +141,7 @@ namespace creaImageIO
                 {
                        bvalid = m_exts.size() == 0? true : false;
                        std::vector<std::string>::iterator it = m_exts.begin();
-                       std::string ext = itr->filename().substr(itr->filename().find_last_of("."));
+                                          std::string ext = itr->path().filename().string().substr(itr->path().filename().string().find_last_of("."));
                        for(; it != m_exts.end(); it++)
                        {
                            if(ext == (*it) )
@@ -152,7 +152,7 @@ namespace creaImageIO
                        }
                        if (!boost::filesystem::is_directory(itr->status()) && bvalid)
                        {
-                           readImg(itr->string().c_str());
+                           readImg(itr->path().string().c_str());
                        }
                 }
          }
index 359223cedda9d4ba2850a4041363c792e9fe3a4b..c1b7acb8fc5e68aab4efdffb84f9e41c6878171c 100644 (file)
@@ -619,7 +619,7 @@ namespace creaImageIO
                {
                        if (recursive) 
                        {
-                               nb += NumberFilesToAdd(itr->string(), recursive);
+                               nb += NumberFilesToAdd(itr->path().string(), recursive);
                        }
                }
                else