+bool Dict::AddNewEntry(DictEntry const & newEntry)
+{
+ const TagKey & key = newEntry.GetKey();
+
+ if(KeyHt.count(key) == 1)
+ {
+ dbg.Verbose(1, "Dict::AddNewEntry already present", key.c_str());
+ return false;
+ }
+ else
+ {
+ KeyHt.insert(
+ std::map<TagKey, DictEntry>::value_type
+ (newEntry.GetKey(), newEntry));
+ NameHt.insert(
+ std::map<TagName, DictEntry>::value_type
+ (newEntry.GetName(), newEntry ));
+ return true;
+ }
+}
+
+/**
+ * \ingroup Dict
+ * \brief replaces an already existing Dicom Element by a new one
+ * @param newEntry new entry (overwrites any previous one with same tag)
+ * @return false if Dicom Element doesn't exist
+ */
+bool Dict::ReplaceEntry(DictEntry const & newEntry)
+{
+ if ( RemoveEntry(newEntry.GetKey()) )
+ {
+ KeyHt.insert(
+ std::map<TagKey, DictEntry>::value_type
+ (newEntry.GetKey(), newEntry));
+ NameHt.insert(
+ std::map<TagName, DictEntry>::value_type
+ (newEntry.GetName(), newEntry ));
+ return true;
+ }
+ return false;
+}
+
+/**
+ * \ingroup Dict
+ * \brief removes an already existing Dicom Dictionary Entry,
+ * identified by its Tag
+ * @param key (group|element)
+ * @return false if Dicom Dictionary Entry doesn't exist
+ */
+bool Dict::RemoveEntry (TagKey const & key)
+{
+ TagKeyHT::const_iterator it = KeyHt.find(key);
+ if(it != KeyHt.end())
+ {
+ const DictEntry & entryToDelete = it->second;
+ NameHt.erase(entryToDelete.GetName());
+ KeyHt.erase(key);
+
+ return true;
+ }
+ else
+ {
+ dbg.Verbose(1, "Dict::RemoveEntry unfound entry", key.c_str());
+ return false;
+ }
+}
+
+/**
+ * \brief removes an already existing Dicom Dictionary Entry,
+ * identified by its group,element number
+ * @param group Dicom group number of the Dicom Element
+ * @param element Dicom element number of the Dicom Element
+ * @return false if Dicom Dictionary Entry doesn't exist
+ */
+bool Dict::RemoveEntry (uint16_t group, uint16_t element)
+{
+ return RemoveEntry(DictEntry::TranslateToKey(group, element));