X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmSQItem.cxx;h=0ed62981aeec4deb87fe99b01256ed36350abb12;hb=05c174bd812b9e375823d6a95683cb5036795a02;hp=e459e53ee0e68d84373ee38e595d9068fcc76495;hpb=9ca0e4bb2208be93bebf21d0c5d75c8018e7605a;p=gdcm.git diff --git a/src/gdcmSQItem.cxx b/src/gdcmSQItem.cxx index e459e53e..0ed62981 100644 --- a/src/gdcmSQItem.cxx +++ b/src/gdcmSQItem.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSQItem.cxx,v $ Language: C++ - Date: $Date: 2005/06/24 10:55:59 $ - Version: $Revision: 1.71 $ + Date: $Date: 2005/10/18 08:35:50 $ + Version: $Revision: 1.76 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -18,8 +18,6 @@ #include "gdcmSQItem.h" #include "gdcmSeqEntry.h" -#include "gdcmValEntry.h" -#include "gdcmBinEntry.h" #include "gdcmGlobal.h" #include "gdcmDictSet.h" #include "gdcmUtil.h" @@ -85,7 +83,9 @@ void SQItem::WriteContent(std::ofstream *fp, FileType filetype) // we just *always* ignore spurious fffe|0000 tag ! if ( (*it)->GetGroup() == 0xfffe && (*it)->GetElement() == 0x0000 ) { - break; // FIXME : continue; ?!? + break; // FIXME : break or continue; ?!? + // --> makes no difference since the only bugged file we have + // contains 'impossible tag' fffe|0000 in last position ! } (*it)->WriteContent(fp, filetype); @@ -103,6 +103,7 @@ void SQItem::WriteContent(std::ofstream *fp, FileType filetype) * \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) { @@ -173,7 +174,7 @@ bool SQItem::RemoveEntryNoDestroy(DocEntry *entryToRemove) if ( *it == entryToRemove ) { DocEntries.erase(it); - gdcmWarningMacro( "One element erased, no destroyed: " + gdcmWarningMacro( "One element removed, no destroyed: " << entryToRemove->GetKey() ); return true; } @@ -197,6 +198,24 @@ void SQItem::ClearEntry() 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