-void gdcmDictSet::LoadDictFromFile(string FileName, DictKey Name) {
- gdcmDict *NewDict = new gdcmDict(FileName.c_str());
- dicts[Name] = NewDict;
+gdcmDictSet::~gdcmDictSet() {
+ for (DictSetHT::iterator tag = Dicts.begin(); tag != Dicts.end(); ++tag) {
+ gdcmDict* EntryToDelete = tag->second;
+ if ( EntryToDelete )
+ delete EntryToDelete;
+ }
+ Dicts.clear();
+}
+
+/**
+ * \ingroup gdcmDictSet
+ * \brief Loads a dictionary from a specified file, and add it
+ * to already the existing ones contained in this gdcmDictSet.
+ * @param FileName Absolute or relative filename containing the
+ * dictionary to load.
+ * @param Name Symbolic name that be used as identifier of the newly
+ * created dictionary.
+ */
+void gdcmDictSet::LoadDictFromFile(std::string FileName, DictKey Name) {
+ gdcmDict *NewDict = new gdcmDict(FileName);
+ Dicts[Name] = NewDict;