-void gdcmDict::Print(ostream& os) {
- for (TagHT::iterator tag = entries.begin(); tag != entries.end(); ++tag){
- os << "Tag : ";
- os << "(" << hex << tag->second->GetGroup() << ',';
- os << hex << tag->second->GetElement() << ") = " << dec;
- os << tag->second->GetVR() << ", ";
- os << tag->second->GetFourth() << ", ";
- os << tag->second->GetName() << "." << endl;
- }
-}
-
-// renvoie une ligne de Dictionnaire Dicom à partir de (numGroup, numElement)
-
-gdcmDictEntry * gdcmDict::GetTag(guint32 group, guint32 element) {
- TagKey key = gdcmDictEntry::TranslateToKey(group, element);
- 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;
-}
-
-
-int gdcmDict::ReplaceEntry(gdcmDictEntry* NewEntry) {
-
- // au cas ou la NewEntry serait incomplete
- // Question : cela peut-il se produire ?
- //
- // --> NON : voir constructeur
- //TagKey key;
- //key = NewEntry->GetKey();
- //if (key =="") {
- // NewEntry->gdcmDictEntry::SetKey(
- // gdcmDictEntry::TranslateToKey(NewEntry->GetGroup(), NewEntry->GetElement())
- // );
- //}
-
- entries.erase (NewEntry->gdcmDictEntry::GetKey());
- entries[ NewEntry->GetKey()] = NewEntry;
- return (1);
- // Question : Dans quel cas ça peut planter ?
+//-----------------------------------------------------------------------------
+// Public
+
+/**
+ * \brief Add all the entries held in a source dictionary
+ * \note it concerns only Private Dictionnary
+ * @param filename from which to build the dictionary.
+ */
+bool Dict::AddDict(std::string const &filename)
+{
+
+ std::ifstream from( filename.c_str() );
+ if ( !from )
+ {
+ gdcmWarningMacro( "Can't open dictionary" << filename.c_str());
+ return false;
+ }
+ else
+ {
+ DoTheLoadingJob(from);
+ return true;
+ }