]> Creatis software - gdcm.git/blobdiff - Testing/TestDicomDir.cxx
* Test/*.cxx and Example/*.cxx: moved some examples away from the
[gdcm.git] / Testing / TestDicomDir.cxx
index 9b6855b701d89420ce598f5ac0fee3bf50ac3d29..35d17d65cd367b942ed30cb8045aeb6f13246d32 100644 (file)
@@ -1,26 +1,13 @@
 #include <iostream>
 #include "gdcm.h"
-#include "gdcmHeaderEntry.h"
+#include "gdcmDocEntry.h"
 #include "gdcmDicomDir.h"
 
 #include <fstream>
-#ifdef GDCM_NO_ANSI_STRING_STREAM
-#  include <strstream>
-#  define  ostringstream ostrstream
-# else
-#  include <sstream>
-#endif
-#include <string>
-#include <iostream>
-
-#define  ostringstream ostrstream
-//extern "C"
-
 
-int testDicomDir(int argc, char* argv[])
+int TestDicomDir(int argc, char* argv[])
 {  
    gdcmDicomDir *e1;
-   ListTag::iterator deb , fin;
    
    ListDicomDirPatient::iterator  itPatient;
    ListDicomDirStudy::iterator    itStudy;
@@ -31,14 +18,16 @@ int testDicomDir(int argc, char* argv[])
    std::string file; 
    if (argc > 1) 
       file = argv[1];    
-   else        
-      file = "../gdcmData/DICOMDIR";
-      
+   else {
+      file += GDCM_DATA_ROOT;
+      file += "/DICOMDIR";
+    }
+
    e1 = new gdcmDicomDir(file.c_str());
-       if (argc > 2) {
-          int level = atoi(argv[2]);   
-          e1->SetPrintLevel(level);
-       }
+   if (argc > 2) {
+      int level = atoi(argv[2]);   
+      e1->SetPrintLevel(level);
+   }
 
    if(e1->GetDicomDirPatients().begin() == e1->GetDicomDirPatients().end() )
    {
@@ -46,8 +35,8 @@ int testDicomDir(int argc, char* argv[])
       return(1);
    }
 
-// Exemples exploitation de la structure
-// DON'T REMOVE neither the folowing code, nor the commented out lines
+// Simple examples of structure exploitation 
+// DON'T REMOVE neither the following code, nor the commented out lines
 
 /*
   cout << std::endl << std::endl