]> Creatis software - gdcm.git/blobdiff - Testing/TestCopyDicom.cxx
ENH: Adding 'gdcm' namespace. Be nice with me this was a ~13000 lines patch. Also...
[gdcm.git] / Testing / TestCopyDicom.cxx
index 2a2416ec647ff0dcf76d1c379dafdc4d7e3cb229..29588aefc33385a86d6ef45761b2b3a8e88b7319 100644 (file)
@@ -9,6 +9,8 @@
 
 #ifndef _WIN32
 #include <unistd.h> //for access, unlink
+#else
+#include <io.h> //for _access on Win32
 #endif
 
 // return true if the file exists
@@ -64,13 +66,13 @@ int TestCopyDicom(int , char* [])
          }
       }
 
-      gdcmFile *original = new gdcmFile( filename );
-      gdcmFile *copy = new gdcmFile( output );
+      gdcm::File *original = new gdcm::File( filename );
+      gdcm::File *copy = new gdcm::File( output );
 
-      TagDocEntryHT & Ht = original->GetHeader()->GetEntry();
+      gdcm::TagDocEntryHT & Ht = original->GetHeader()->GetEntry();
 
       size_t dataSize = original->GetImageDataSize();
-      void *imageData = original->GetImageData();
+      uint8_t* imageData = original->GetImageData();
 
       //First of all copy the header field by field
   
@@ -79,21 +81,21 @@ int TestCopyDicom(int , char* [])
       // (the user does NOT have to know the way we implemented the Header !)
       // Waiting for a 'clean' solution, I keep the method ...JPRx
 
-      gdcmDocEntry* d;
+      gdcm::DocEntry* d;
 
-      for (TagDocEntryHT::iterator tag = Ht.begin(); tag != Ht.end(); ++tag)
+      for (gdcm::TagDocEntryHT::iterator tag = Ht.begin(); tag != Ht.end(); ++tag)
       {
          d = tag->second;
-         if ( gdcmBinEntry* b = dynamic_cast<gdcmBinEntry*>(d) )
+         if ( gdcm::BinEntry* b = dynamic_cast<gdcm::BinEntry*>(d) )
          {              
             copy->GetHeader()->ReplaceOrCreateByNumber( 
-                                 b->GetVoidArea(),
+                                 b->GetBinArea(),
                                  b->GetLength(),
                                  b->GetGroup(), 
                                  b->GetElement(),
                                  b->GetVR() );
          }
-         else if ( gdcmValEntry* v = dynamic_cast<gdcmValEntry*>(d) )
+         else if ( gdcm::ValEntry* v = dynamic_cast<gdcm::ValEntry*>(d) )
          {   
              copy->GetHeader()->ReplaceOrCreateByNumber( 
                                  v->GetValue(),
@@ -119,7 +121,7 @@ int TestCopyDicom(int , char* [])
       delete original;
       delete copy;
 
-      copy = new gdcmFile( output );
+      copy = new gdcm::File( output );
 
       //Is the file written still gdcm parsable ?
       if ( !copy->GetHeader()->IsReadable() )