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
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 );
}
}
Filename = filename;
+ from.close();
}
- from.close();
}
/**
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)
os << s.str();
}
+
//-----------------------------------------------------------------------------
// Public
/**
if(KeyHt.count(key) == 1)
{
- Debug::Verbose(1, "Dict::AddNewEntry already present", key.c_str());
+ gdcmVerboseMacro( "Already present" << key.c_str());
return false;
}
else
}
else
{
- Debug::Verbose(1, "Dict::RemoveEntry unfound entry", key.c_str());
+ gdcmVerboseMacro( "Unfound entry" << key.c_str());
return false;
}
}
* @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);