X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=src%2FgdcmDict.cxx;h=9c3235c78aecf84bf549034b05653de9058ba1d6;hb=5887c4beef24959af83e43efad0bb86acac9339e;hp=1985e4e3eeb3e0bb7d69edbb2129a2792a26258e;hpb=70b9dde9da207191fa6d799fdf03c2aff7941273;p=gdcm.git diff --git a/src/gdcmDict.cxx b/src/gdcmDict.cxx index 1985e4e3..9c3235c7 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/01/07 16:26:12 $ - Version: $Revision: 1.58 $ + Date: $Date: 2005/01/12 15:23:44 $ + Version: $Revision: 1.62 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -44,7 +44,7 @@ Dict::Dict(std::string const &filename) std::ifstream from( filename.c_str() ); if( !from ) { - Debug::Verbose(2,"Dict::Dict: can't open dictionary", filename.c_str()); + gdcmVerboseMacro( "Can't open dictionary" << filename.c_str()); // Using default embeded one: FillDefaultDataDict( this ); } @@ -65,8 +65,8 @@ Dict::Dict(std::string const &filename) } Filename = filename; + from.close(); } - from.close(); } /** @@ -89,16 +89,6 @@ Dict::~Dict() void Dict::Print(std::ostream &os) { os << "Dict file name : " << Filename << std::endl; - PrintByKey(os); -} - -/** - * \brief Print all the dictionary entries contained in this dictionary. - * Entries will be sorted by tag i.e. the couple (group, element). - * @param os The output stream to be written to. - */ -void Dict::PrintByKey(std::ostream &os) -{ std::ostringstream s; for (TagKeyHT::iterator tag = KeyHt.begin(); tag != KeyHt.end(); ++tag) @@ -114,6 +104,7 @@ void Dict::PrintByKey(std::ostream &os) os << s.str(); } + //----------------------------------------------------------------------------- // Public /** @@ -128,7 +119,7 @@ bool Dict::AddNewEntry(DictEntry const &newEntry) if(KeyHt.count(key) == 1) { - Debug::Verbose(1, "Dict::AddNewEntry already present", key.c_str()); + gdcmVerboseMacro( "Already present" << key.c_str()); return false; } else @@ -172,7 +163,7 @@ bool Dict::RemoveEntry (TagKey const &key) } else { - Debug::Verbose(1, "Dict::RemoveEntry unfound entry", key.c_str()); + gdcmVerboseMacro( "Unfound entry" << key.c_str()); return false; } } @@ -195,7 +186,7 @@ bool Dict::RemoveEntry (uint16_t group, uint16_t elem) * @param elem element of the entry to be found * @return the corresponding dictionnary entry when existing, NULL otherwise */ -DictEntry *Dict::GetDictEntryByNumber(uint16_t group, uint16_t elem) +DictEntry *Dict::GetDictEntry(uint16_t group, uint16_t elem) { TagKey key = DictEntry::TranslateToKey(group, elem); TagKeyHT::iterator it = KeyHt.find(key);