]> Creatis software - gdcm.git/blobdiff - src/gdcmDicomDirElement.cxx
2004-02-06 Jean-Pierre Roux
[gdcm.git] / src / gdcmDicomDirElement.cxx
index cc83188dd8e4926c0d731f44611de96b9954cfbe..25afc82dcd1c4be3e4c53161654d51097272db32 100644 (file)
@@ -1,6 +1,7 @@
 // gdcmDicomDirElement.cxx
 //-----------------------------------------------------------------------------
 #include <fstream>
+#include <stdio.h>    // For sprintf
 
 #include "gdcmDicomDirElement.h"
 #include "gdcmUtil.h"
 
 //-----------------------------------------------------------------------------
 // Constructor / Destructor
-gdcmDicomDirElement::gdcmDicomDirElement(void) 
-{
+
+/**
+ * \ingroup gdcmDicomDirElement
+ * \brief   constructor 
+ */
+ gdcmDicomDirElement::gdcmDicomDirElement(void) {
    std::string filename=gdcmDictSet::BuildDictPath() + std::string(DICT_ELEM);
    std::ifstream from(filename.c_str());
    dbg.Error(!from, "gdcmDicomDirElement::gdcmDicomDirElement: can't open dictionary",filename.c_str());
@@ -35,8 +40,8 @@ gdcmDicomDirElement::gdcmDicomDirElement(void)
       from.getline(buff, 1024, ' ');
       type = buff;
 
-      if( (type=="metaElem") || (type=="patientElem") || 
-          (type=="studyElem") || (type=="serieElem") || 
+      if( (type=="metaElem")  || (type=="patientElem") || 
+          (type=="studyElem") || (type=="serieElem")   || 
           (type=="imageElem") )
       {
          from >> std::hex >> elem.group >> elem.elem;
@@ -64,8 +69,11 @@ gdcmDicomDirElement::gdcmDicomDirElement(void)
    from.close();
 }
 
-gdcmDicomDirElement::~gdcmDicomDirElement() 
-{
+/**
+ * \ingroup gdcmDicomDirElement
+ * \brief   destructor 
+ */
+ gdcmDicomDirElement::~gdcmDicomDirElement() {
    MetaList.clear();
    PatientList.clear();
    StudyList.clear();
@@ -76,12 +84,12 @@ gdcmDicomDirElement::~gdcmDicomDirElement()
 //-----------------------------------------------------------------------------
 // Print
 /**
- * \ingroup gdcmVR
- * \brief   Print all 
+ * \ingroup gdcmDicomDirElement
+ * \brief   Print all
+ * \todo add a 'Print Level' check 
  * @param   os The output stream to be written to.
  */
-void gdcmDicomDirElement::Print(std::ostream &os) 
-{
+void gdcmDicomDirElement::Print(std::ostream &os) {
    std::ostringstream s;
    std::list<gdcmElement>::iterator it;
    char greltag[10];  //group element tag