X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmDict.cxx;h=3514749ecbbc4dee8eb260bfbb0e3e49377379ed;hb=8afb2999a90aefbce7662c43fe19dad237d49331;hp=271a2346640b96f1ed8233d6a9d30fd3423f334f;hpb=51b61705e90b352de08519835fa1c63b81bca616;p=gdcm.git diff --git a/src/gdcmDict.cxx b/src/gdcmDict.cxx index 271a2346..3514749e 100644 --- a/src/gdcmDict.cxx +++ b/src/gdcmDict.cxx @@ -2,10 +2,9 @@ #include "gdcm.h" #include "gdcmUtil.h" -gdcmDict::gdcmDict(char * FileName) { +gdcmDict::gdcmDict(const char* FileName) { std::ifstream from(FileName); - dbg.Error(!from, "gdcmDictSet::gdcmDictSet:", - "can't open dictionary"); + dbg.Error(!from, "gdcmDict::gdcmDict: can't open dictionary", FileName); guint16 group, element; // CLEANME : use defines for all those constants char buff[1024]; @@ -40,6 +39,10 @@ void gdcmDict::Print(ostream& os) { gdcmDictEntry * gdcmDict::GetTag(guint32 group, guint32 element) { TagKey key = gdcmDictEntry::TranslateToKey(group, element); - TagHT::iterator found = entries.find(key); - return found->second; + if ( ! entries.count(key)) + return (gdcmDictEntry*)0; + if (entries.count(key) > 1) + dbg.Verbose(0, "gdcmDict::GetTag", + "multiple entries for this key (FIXME) !"); + return entries.find(key)->second; }