+/**
+ * \brief Clear the std::list from given entry AND delete the entry.
+ * @param entryToRemove Entry to remove AND delete.
+ * \warning Some problems when using under Windows... prefer the use of
+ * Initialize / GetNext methods
+ * @return true if the entry was found and removed; false otherwise
+ */
+bool SQItem::RemoveEntry( DocEntry* entryToRemove)
+{
+ for(ListDocEntry::iterator it = DocEntries.begin();
+ it != DocEntries.end();
+ ++it)
+ {
+ if( *it == entryToRemove)
+ {
+ DocEntries.erase(it);
+ gdcmVerboseMacro( "One element erased: " << entryToRemove->GetKey() );
+ delete entryToRemove;
+ return true;
+ }
+ }
+ gdcmVerboseMacro( "Entry not found: " << entryToRemove->GetKey() );
+ return false ;
+}
+
+/**
+ * \brief Clear the std::list from given entry BUT keep the entry.
+ * @param entryToRemove Entry to remove.
+ * @return true if the entry was found and removed; false otherwise
+ */
+bool SQItem::RemoveEntryNoDestroy(DocEntry* entryToRemove)
+{
+ for(ListDocEntry::iterator it = DocEntries.begin();
+ it != DocEntries.end();
+ ++it)
+ {
+ if( *it == entryToRemove)
+ {
+ DocEntries.erase(it);
+ gdcmVerboseMacro( "One element erased, no destroyed: "
+ << entryToRemove->GetKey() );
+ return true;
+ }
+ }
+
+ gdcmVerboseMacro( "Entry not found:" << entryToRemove->GetKey() );
+ return false ;
+}
+
+/**
+ * \brief Get the first entry while visiting the SQItem
+ * \return The first DocEntry if found, otherwhise 0
+ */
+DocEntry * SQItem::GetFirstEntry()
+{
+ ItDocEntries = DocEntries.begin();
+ if (ItDocEntries != DocEntries.end())
+ return *ItDocEntries;
+ return 0;
+}
+
+/**
+ * \brief Get the next entry while visiting the chained list
+ * \return The next DocEntry if found, otherwhise NULL
+ */
+DocEntry *SQItem::GetNextEntry()
+{
+ // gdcmAssertMacro (ItDocEntries != DocEntries.end());
+ {
+ ++ItDocEntries;
+ if (ItDocEntries != DocEntries.end())
+ return *ItDocEntries;
+ return NULL;
+ }
+}