]> Creatis software - gdcm.git/blobdiff - src/gdcmDictEntry.cxx
* src/gdcmDictSet.h : set the default output to the os variable
[gdcm.git] / src / gdcmDictEntry.cxx
index 886dd48912aa37898cb6854c3471e91d4ffe4d53..a4bb7060bcdb5a1a0c98042ccc1392e6abb2a88e 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDictEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/10 17:17:52 $
-  Version:   $Revision: 1.38 $
+  Date:      $Date: 2005/01/13 16:35:37 $
+  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
@@ -20,6 +20,9 @@
 #include "gdcmDebug.h"
 #include "gdcmUtil.h"
 
+#include <iomanip> // for std::ios::left, ...
+#include <fstream>
+
 namespace gdcm 
 {
 
@@ -49,6 +52,27 @@ DictEntry::DictEntry(uint16_t group, uint16_t element,
 
 //-----------------------------------------------------------------------------
 // Print
+void DictEntry::Print(std::ostream &os)
+{
+   std::string vr;
+   std::ostringstream s;
+
+   vr = GetVR();
+   if(vr==GDCM_UNKNOWN)
+      vr="  ";
+
+   s << DictEntry::TranslateToKey(GetGroup(),GetElement()); 
+   s << " [" << vr  << "] ";
+
+   if (PrintLevel >= 1)
+   {
+      s.setf(std::ios::left);
+      s << std::setw(66-GetName().length()) << " ";
+   }
+
+   s << "[" << GetName()<< "]";
+   os << s.str();
+}
 
 //-----------------------------------------------------------------------------
 // Public