]> Creatis software - gdcm.git/blobdiff - src/gdcmDicomDir.cxx
Add #include for BCC
[gdcm.git] / src / gdcmDicomDir.cxx
index 08be083ff00dcba018619cc0f06969b8cdd29fa4..a12b7fa7fed62d2c95a81c59573bb3c84afabafd 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/12/21 14:50:59 $
-  Version:   $Revision: 1.182 $
+  Date:      $Date: 2006/01/27 10:01:33 $
+  Version:   $Revision: 1.185 $
   
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 #else
 #   include <unistd.h>
 #endif
+
+#if defined(__BORLANDC__)
+   #include <mem.h> // for memset
+#endif 
+
 // ----------------------------------------------------------------------------
 //         Note for future developpers
 // ----------------------------------------------------------------------------
@@ -588,7 +593,7 @@ void DicomDir::CreateDicomDir()
 
       // A decent DICOMDIR has much more images than series,
       // more series than studies, and so on.
-      // This is the right order to preform the tests
+      // This is the right order to perform the tests
 
       if ( v == "IMAGE " ) 
       {
@@ -942,8 +947,11 @@ void DicomDir::SetElement(std::string const &path, DicomDirType type,
                else
                { 
                  // avoid the first '/' in File name !
-                 //val = &(header->GetFileName().c_str()[path.length()]);
-                 val = &(header->GetFileName().c_str()[path.length()+1]);
+                 if ( header->GetFileName().c_str()[path.length()] 
+                                                      == GDCM_FILESEPARATOR )
+                    val = &(header->GetFileName().c_str()[path.length()+1]);
+                 else  
+                    val = &(header->GetFileName().c_str()[path.length()]);   
                }
                break;
     
@@ -1002,8 +1010,8 @@ void DicomDir::SetElement(std::string const &path, DicomDirType type,
          val += Util::GetVersion();
       }
 */ 
-      if (val == "") 
-        entry->SetString( val ); // troubles expected when vr=SQ ...
+
+      entry->SetString( val ); // troubles expected when vr=SQ ...
 
       if ( type == GDCM_DICOMDIR_META ) // fusible : should never print !
       {