From: malaterre Date: Mon, 11 Jul 2005 14:53:15 +0000 (+0000) Subject: ENH: A TagKey is a TagKey and not a string or TagName... #2 X-Git-Tag: Version1.2.bp~326 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=f0022701102f3d16398d908a2b526fb36f334e31;p=gdcm.git ENH: A TagKey is a TagKey and not a string or TagName... #2 --- diff --git a/Testing/TestDict.cxx b/Testing/TestDict.cxx index 8cf93f70..a883b477 100644 --- a/Testing/TestDict.cxx +++ b/Testing/TestDict.cxx @@ -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) { diff --git a/src/gdcmDict.cxx b/src/gdcmDict.cxx index 0d219d9f..f95f8d54 100644 --- a/src/gdcmDict.cxx +++ b/src/gdcmDict.cxx @@ -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; } } diff --git a/src/gdcmDictSet.cxx b/src/gdcmDictSet.cxx index 646d3374..779d1b0e 100644 --- a/src/gdcmDictSet.cxx +++ b/src/gdcmDictSet.cxx @@ -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; diff --git a/src/gdcmElementSet.cxx b/src/gdcmElementSet.cxx index 91c1b6d2..e343ff9f 100644 --- a/src/gdcmElementSet.cxx +++ b/src/gdcmElementSet.cxx @@ -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