+ // Create a new binEntry if necessary
+ if( !binEntry)
+ {
+ binEntry = NewBinEntry(group, elem, vr);
+
+ if ( !AddEntry(binEntry) )
+ {
+ gdcmVerboseMacro( "AddEntry failed allthough this is a creation.");
+
+ delete binEntry;
+ return NULL;
+ }
+ }
+
+ // Set the binEntry value
+ uint8_t *tmpArea;
+ if( lgth>0 && binArea )
+ {
+ tmpArea = new uint8_t[lgth];
+ memcpy(tmpArea,binArea,lgth);
+ }
+ else
+ {
+ tmpArea = 0;
+ }
+ if( !SetBinEntry(tmpArea,lgth,binEntry) )
+ {
+ if( tmpArea )
+ {
+ delete[] tmpArea;
+ }
+ }
+
+ return binEntry;
+}
+
+/*
+ * \brief Modifies the value of a given Header Entry (Dicom Element)
+ * when it exists. Creates it when unexistant.
+ * @param group Group number of the Entry
+ * @param elem Element number of the Entry
+ * \return pointer to the modified/created SeqEntry (NULL when creation
+ * failed).
+ */
+SeqEntry *DocEntrySet::InsertSeqEntry(uint16_t group, uint16_t elem)