]> Creatis software - gdcm.git/commitdiff
ENH: A TagKey is a TagKey and not a string or TagName... #2
authormalaterre <malaterre>
Mon, 11 Jul 2005 14:53:15 +0000 (14:53 +0000)
committermalaterre <malaterre>
Mon, 11 Jul 2005 14:53:15 +0000 (14:53 +0000)
Testing/TestDict.cxx
src/gdcmDict.cxx
src/gdcmDictSet.cxx
src/gdcmElementSet.cxx

index 8cf93f70b91684ee70b927cf3b92bea16071fe6e..a883b4774a22f36910111e74a69d5114c72a29dd 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestDict.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/02/02 10:05:26 $
-  Version:   $Revision: 1.7 $
+  Date:      $Date: 2005/07/11 14:53:15 $
+  Version:   $Revision: 1.8 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -81,7 +81,7 @@ int TestDict(int , char *[])
    std::cout<<"#######################################################\n";
    const int ENTRY_GR = 0x10;
    const int ENTRY_EL = 0x20;
-   std::string key=gdcm::DictEntry::TranslateToKey(ENTRY_GR,ENTRY_EL);
+   gdcm::TagKey key = gdcm::DictEntry::TranslateToKey(ENTRY_GR,ENTRY_EL);
    gdcm::DictEntry *entry=pubDict->GetEntry(ENTRY_GR,ENTRY_EL);
    if(!entry)
    {
index 0d219d9f0a5347920c4b08140a6ca3307df6c1fa..f95f8d5469439fb9fc2f3290d3a1c31530cd1dba 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDict.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/06/24 10:55:58 $
-  Version:   $Revision: 1.77 $
+  Date:      $Date: 2005/07/11 14:53:16 $
+  Version:   $Revision: 1.78 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -62,7 +62,7 @@ Dict::Dict(std::string const &filename)
    }
    else
    {
-      while (!from.eof())
+      while (!from.eof() && from)
       {
          from >> std::hex;
          from >> group;
@@ -102,7 +102,7 @@ bool Dict::AddEntry(DictEntry const &newEntry)
 
    if ( KeyHt.count(key) == 1 )
    {
-      gdcmWarningMacro( "Already present" << key.c_str());
+      gdcmErrorMacro( "Already present:" << key );
       return false;
    } 
    else 
@@ -144,7 +144,7 @@ bool Dict::RemoveEntry(TagKey const &key)
    } 
    else 
    {
-      gdcmWarningMacro( "Unfound entry" << key.c_str());
+      gdcmWarningMacro( "Unfound entry" << key );
       return false;
   }
 }
index 646d3374ab2e0dd3c7c9c3373ff0fbbe13c6d467..779d1b0e669eb7bd794f04f73072706343f2676f 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDictSet.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/06/24 10:55:58 $
-  Version:   $Revision: 1.65 $
+  Date:      $Date: 2005/07/11 14:53:16 $
+  Version:   $Revision: 1.66 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -118,7 +118,7 @@ DictEntry *DictSet::NewVirtualDictEntry( uint16_t group,
   //                         + "#" + vr + "#" + vm + "#" + name;
    char res[10];
    sprintf(res,"%04x|%04x", group, elem);
-   std::string tag = res;
+   TagKey tag = res;
    tag += "#" + vr + "#" + vm + "#" + name;  
   
    TagKeyHT::iterator it;
index 91c1b6d229b08bc39f72f64e02672919a419fc7d..e343ff9f7c16a9875450a14e4ff45942f7e7d9d1 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmElementSet.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/06/24 10:55:59 $
-  Version:   $Revision: 1.59 $
+  Date:      $Date: 2005/07/11 14:53:16 $
+  Version:   $Revision: 1.60 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -72,7 +72,7 @@ bool ElementSet::AddEntry(DocEntry *newEntry)
 
    if ( TagHT.count(key) == 1 )
    {
-      gdcmWarningMacro( "Key already present: " << key.c_str());
+      gdcmWarningMacro( "Key already present: " << key );
       return false;
    }
    else