]> Creatis software - gdcm.git/blobdiff - src/gdcmDicomDirPatient.cxx
* Fix memory leaks
[gdcm.git] / src / gdcmDicomDirPatient.cxx
index 72081cf3a763f166569d9caa664ba97d9eb039fe..7c2b598de7dd780f5c52932c5630005cad4b7197 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirPatient.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/25 15:44:23 $
-  Version:   $Revision: 1.33 $
+  Date:      $Date: 2005/06/24 10:55:58 $
+  Version:   $Revision: 1.38 $
                                                                                 
   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();
@@ -50,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
 /**
@@ -91,7 +70,7 @@ void DicomDirPatient::WriteContent(std::ofstream *fp, FileType t)
 }
 
 /**
- * \brief   adds a new Patient at the begining of the PatientList
+ * \brief   adds a new Patient at the beginning of the PatientList
  *          of a partially created DICOMDIR
  */
 DicomDirStudy* DicomDirPatient::NewStudy()
@@ -163,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