]> Creatis software - gdcm.git/blobdiff - src/gdcmDictGroupName.cxx
* Fix compilation errors in the Python part
[gdcm.git] / src / gdcmDictGroupName.cxx
index 680c199d85ab1573d30bbdeddae61c94e4aaf573..15ae5cc363ca27a9ff1df8bdcf1b22844703ea5d 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDictGroupName.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/04/05 10:56:25 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2005/06/24 10:55:58 $
+  Version:   $Revision: 1.4 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -23,6 +23,7 @@
 
 #include <fstream>
 #include <iostream>
+#include <iomanip>
 
 namespace gdcm 
 {
@@ -40,7 +41,7 @@ DictGroupName::DictGroupName()
 {
    std::string filename = DictSet::BuildDictPath() + DICT_GROUP_NAME;
    std::ifstream from(filename.c_str());
-   if(!from)
+   if ( !from )
    {
       gdcmWarningMacro("Can't open dictionary" << filename.c_str());
       FillDefaultDictGroupName(groupName);
@@ -49,7 +50,7 @@ DictGroupName::DictGroupName()
    {
       char buff[1024];
       uint16_t key;
-      GroupName value;
+      TagName value;
    
       while (!from.eof()) 
       {
@@ -60,7 +61,7 @@ DictGroupName::DictGroupName()
          from.getline(buff, 1024, '"');
          from.getline(buff, 1024, '"');
          value = buff;
-         if(!from.eof())
+         if ( !from.eof() )
             groupName[key] = value;
 
          from.getline(buff, 1024, '\n');
@@ -79,10 +80,10 @@ DictGroupName::~DictGroupName()
 
 //-----------------------------------------------------------------------------
 // Public
-const GroupName &DictGroupName::GetName(uint16_t group)
+const TagName &DictGroupName::GetName(uint16_t group)
 {
    DictGroupNameHT::const_iterator it = groupName.find(group);
-   if (it == groupName.end())
+   if ( it == groupName.end() )
    {
       return GDCM_UNFOUND;
    }
@@ -107,8 +108,8 @@ void DictGroupName::Print(std::ostream &os)
 
    for (DictGroupNameHT::iterator it = groupName.begin(); it != groupName.end(); ++it)
    {
-      s << "DictGroupName : " << std::hex << it->first << std::dec 
-        << " = " << it->second << std::endl;
+      s << "DictGroupName : 0x" << std::hex << std::setw(4) << it->first 
+        << std::dec << " = " << it->second << std::endl;
    }
    os << s.str();
 }