X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmDict.cxx;h=3514749ecbbc4dee8eb260bfbb0e3e49377379ed;hb=1a4c3a039ea7c7fc09419ffe3c28ed7827866788;hp=8b42624d8924da9e841ddcf64e8d2b393c451ded;hpb=e8be02129ece7a8c7dd90307a8c83e1ef5d157b6;p=gdcm.git diff --git a/src/gdcmDict.cxx b/src/gdcmDict.cxx index 8b42624d..3514749e 100644 --- a/src/gdcmDict.cxx +++ b/src/gdcmDict.cxx @@ -1,11 +1,10 @@ #include -#include "gdcmlib.h" +#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; }