]> Creatis software - gdcm.git/blobdiff - src/gdcmDicomDirPatient.cxx
Track troubles on Big endian processors
[gdcm.git] / src / gdcmDicomDirPatient.cxx
index ea7d00fc7d7c13dd0686ed64e37b5625048f48cd..73680f8051df592defd78eac10bae7c8e14198f7 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirPatient.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/31 12:19:33 $
-  Version:   $Revision: 1.35 $
+  Date:      $Date: 2005/10/25 14:52:33 $
+  Version:   $Revision: 1.39 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 
 namespace gdcm 
 {
-
 //-----------------------------------------------------------------------------
 // Constructor / Destructor
 /**
  * \brief   Constructor
  * \note End user must use : DicomDir::NewPatient()
  */
-DicomDirPatient::DicomDirPatient(bool empty):
-   DicomDirObject()
+DicomDirPatient::DicomDirPatient(bool empty)
+                :DicomDirObject()
 {
-   if( !empty )
+   if ( !empty )
    {
       ListDicomDirStudyElem const &elemList = 
          Global::GetDicomDirElements()->GetDicomDirPatientElements();
@@ -51,27 +50,6 @@ DicomDirPatient::~DicomDirPatient()
    ClearStudy();
 }
 
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief   Prints the Object
- * @param os ostream to write to 
- * @param indent Indentation string to be prepended during printing
- */ 
-void DicomDirPatient::Print(std::ostream &os, std::string const & )
-{
-   os << "PATIENT" << std::endl;
-   DicomDirObject::Print(os);
-
-   for(ListDicomDirStudy::const_iterator cc = Studies.begin();
-                                         cc != Studies.end(); 
-                                       ++cc )
-   {
-      (*cc)->SetPrintLevel(PrintLevel);
-      (*cc)->Print(os);
-   }
-}
-
 //-----------------------------------------------------------------------------
 // Public
 /**
@@ -97,9 +75,9 @@ void DicomDirPatient::WriteContent(std::ofstream *fp, FileType t)
  */
 DicomDirStudy* DicomDirPatient::NewStudy()
 {
-   DicomDirStudy *st = new DicomDirStudy();
-   Studies.push_back(st);
-   return st
+   DicomDirStudy *dd = DicomDirStudy::New();
+   Studies.push_back(dd);
+   return dd
 }   
 
 /**
@@ -111,7 +89,7 @@ void DicomDirPatient::ClearStudy()
                                          cc != Studies.end(); 
                                        ++cc )
    {
-      delete *cc;
+      (*cc)->Delete();
    }
    Studies.clear();
 }
@@ -164,5 +142,26 @@ DicomDirStudy *DicomDirPatient::GetLastStudy()
 //-----------------------------------------------------------------------------
 // Private
 
+//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief   Prints the Object
+ * @param os ostream to write to 
+ * @param indent Indentation string to be prepended during printing
+ */ 
+void DicomDirPatient::Print(std::ostream &os, std::string const & )
+{
+   os << "PATIENT" << std::endl;
+   DicomDirObject::Print(os);
+
+   for(ListDicomDirStudy::const_iterator cc = Studies.begin();
+                                         cc != Studies.end(); 
+                                       ++cc )
+   {
+      (*cc)->SetPrintLevel(PrintLevel);
+      (*cc)->Print(os);
+   }
+}
+
 //-----------------------------------------------------------------------------
 } // end namespace gdcm