+ DocEntry* entry = i->second;
+ entry->Print(os);
+ if ( SeqEntry* seqEntry = dynamic_cast<SeqEntry*>(entry) )
+ {
+ (void)seqEntry;
+ // Avoid the newline for a sequence:
+ continue;
+ }
+ os << std::endl;
+ }
+}
+
+/**
+ * \brief Writes the Header Entries (Dicom Elements)
+ * from the H Table
+ * @return
+ */
+void ElementSet::Write(std::ofstream* fp, FileType filetype)
+{
+ for (TagDocEntryHT::const_iterator i = TagHT.begin(); i != TagHT.end(); ++i)
+ {
+ i->second->Write(fp, filetype);
+ }
+}
+//-----------------------------------------------------------------------------
+// Protected
+
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// Private
+
+/**
+ * \brief add a new Dicom Element pointer to the H Table
+ * @param newEntry entry to add
+ */
+bool ElementSet::AddEntry( DocEntry* newEntry)
+{
+ TagKey key = newEntry->GetKey();
+
+ if( TagHT.count(key) == 1 )
+ {
+ dbg.Verbose(1, "ElementSet::AddEntry key already present: ",
+ key.c_str());
+ return false;