Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2005/07/06 15:18:42 $
- Version: $Revision: 1.259 $
+ Date: $Date: 2005/07/07 13:11:38 $
+ Version: $Revision: 1.260 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
if ( IsDocumentAlreadyLoaded )
{
+ /*
if ( Filename == fileName )
{
gdcmWarningMacro( "The file was already parsed inside this "
<< Filename.c_str() );
return true;
}
-
+ */
gdcmWarningMacro( "A file was already parsed inside this "
<< "gdcm::Document (previous name was: "
<< Filename.c_str() << ". New name is :"
newValEntry = dynamic_cast<ValEntry*>(newDocEntry);
newBinEntry = dynamic_cast<BinEntry*>(newDocEntry);
- if ( newValEntry || newBinEntry )
+ if ( newValEntry || newBinEntry )
{
+ //////////////////////////// ContentEntry
if ( newBinEntry )
{
vr = newDocEntry->GetVR();
}
//////////////////// BinEntry or UNKOWN VR:
+
// When "this" is a Document the Key is simply of the
// form ( group, elem )...
if ( dynamic_cast< Document* > ( set ) )
+ newBinEntry->GetKey() );
}
- LoadDocEntry( newBinEntry );
if ( !set->AddEntry( newBinEntry ) )
{
gdcmWarningMacro( "in ParseDES : cannot add a BinEntry "
<< newBinEntry->GetKey() );
used=false;
}
- }
+ else
+ {
+ // Load only if we can add (not a duplicate key)
+ LoadDocEntry( newBinEntry );
+ }
+ } // end BinEntry
else
{
/////////////////////// ValEntry
newValEntry->SetKey( parentSQItem->GetBaseTagKey()
+ newValEntry->GetKey() );
}
-
- LoadDocEntry( newValEntry );
- bool delimitor=newValEntry->IsItemDelimitor();
if ( LoadMode & NO_SHADOW ) // User asked to skip, if possible,
// shadow groups ( if possible :
<< newValEntry->GetKey() );
used=false;
}
-
- if (delimitor)
+ else
{
- if ( !used )
- delete newDocEntry;
- break;
+ // Load only if we can add (not a duplicate key)
+ LoadDocEntry( newValEntry );
}
- if ( !delim_mode && ((long)(Fp->tellg())-offset) >= l_max )
+
+ bool delimitor=newValEntry->IsItemDelimitor();
+
+ if ( delimitor ||
+ (!delim_mode && ((long)(Fp->tellg())-offset) >= l_max) )
{
if ( !used )
delete newDocEntry;
delete newDocEntry;
break;
}
- }
+ } // end SeqEntry : VR = "SQ"
if ( !used )
delete newDocEntry;
- }
+ } // end While
}
/**