Program: gdcm
Module: $RCSfile: gdcmSQItem.cxx,v $
Language: C++
- Date: $Date: 2005/02/07 08:48:18 $
- Version: $Revision: 1.70 $
+ Date: $Date: 2005/07/12 17:08:12 $
+ Version: $Revision: 1.74 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* \brief Inserts *in the right place* any Entry (Dicom Element)
* into the Sequence Item
* @param entry Entry to add
+ * @return always true
*/
bool SQItem::AddEntry(DocEntry *entry)
{
it != DocEntries.end();
++it)
{
- if( *it == entryToRemove )
+ if ( *it == entryToRemove )
{
DocEntries.erase(it);
gdcmWarningMacro( "One element erased: " << entryToRemove->GetKey() );
it != DocEntries.end();
++it)
{
- if( *it == entryToRemove )
+ if ( *it == entryToRemove )
{
DocEntries.erase(it);
- gdcmWarningMacro( "One element erased, no destroyed: "
+ gdcmWarningMacro( "One element removed, no destroyed: "
<< entryToRemove->GetKey() );
return true;
}
DocEntries.clear();
}
+/**
+ * \brief Clear the std::list from given Sequence Item BUT keep the entries
+ */
+void SQItem::ClearEntryNoDestroy()
+{
+ DocEntries.clear();
+}
+
+
+/**
+ * \brief Move all the entries from a given Sequence Item
+ */
+void SQItem::MoveObject(SQItem *source)
+{
+ DocEntries = source->DocEntries;
+ source->ClearEntryNoDestroy();
+}
+
/**
* \brief Get the first Dicom entry while visiting the SQItem
* \return The first DocEntry if found, otherwhise 0
DocEntry *SQItem::GetFirstEntry()
{
ItDocEntries = DocEntries.begin();
- if( ItDocEntries != DocEntries.end() )
+ if ( ItDocEntries != DocEntries.end() )
return *ItDocEntries;
return 0;
}
DocEntry *SQItem::GetNextEntry()
{
++ItDocEntries;
- if( ItDocEntries != DocEntries.end() )
+ if ( ItDocEntries != DocEntries.end() )
return *ItDocEntries;
return NULL;
}