- // que l'on ai passe un root directory ou un DICOMDIR
- // et quelle que soit la valeur de parseDir,
- // on a lance gdcmParser
-
- startMethod= NULL;
- progressMethod= NULL;
- endMethod= NULL;
- startMethodArgDelete= NULL;
- progressMethodArgDelete=NULL;
- endMethodArgDelete= NULL;
- startArg= NULL;
- progressArg= NULL;
- endArg= NULL;
-
- progress=0.0;
- abort=false;
-
- metaElems=NULL;
-
-// gdcmParser already executed
-// if user passed a root directory, sure we didn't get anything
-
- if( GetListEntry().begin()==GetListEntry().end() )
- {
- // if parseDir == false, it should be tagged as an error
- dbg.Verbose(0, "gdcmDicomDir::gdcmDicomDir : entry list empty");
-
- if(strlen(FileName)==1 && FileName[0]=='.') { // user passed '.' as Name
- // we get current directory name
- char*dummy=(char*) malloc(1000);
- getcwd(dummy,(size_t)1000);
- SetFileName(dummy); // will be converted into a string
- free(dummy); // no longer needed
- }
-
- if(parseDir)
- {
- dbg.Verbose(0, "gdcmDicomDir::gdcmDicomDir : Parse directory"
- " and create the DicomDir");
- ParseDirectory();
- }
- }
- else {
- CreateDicomDir();
- CheckBoundaries(); // to maintain consistency between
- // home-made gdcmDicomDir
- // and the ones comming from a DICOMDIR file
- }
-}
-
-/**
- * \ingroup gdcmDicomDir
- * \brief Constructor : creates an empty gdcmDicomDir
- * @param exception_on_error whether we want to throw an exception or not
- */
-gdcmDicomDir::gdcmDicomDir(bool exception_on_error):
- gdcmParser(exception_on_error)
-{
- startMethod= NULL;
- progressMethod= NULL;
- endMethod= NULL;
- startMethodArgDelete= NULL;
- progressMethodArgDelete=NULL;
- endMethodArgDelete= NULL;
- startArg= NULL;
- progressArg= NULL;
- endArg= NULL;
-
- progress=0.0;
- abort=false;
- std::string pathBidon = ""; // Sorry, NULL not allowed ...
- SetElement(pathBidon, GDCM_DICOMDIR_META, NULL); // Set the META elements
-
- AddDicomDirMetaToEnd(listEntries.begin(),--listEntries.end());
+ // At this step, Document constructor is already executed,
+ // whatever user passed (either a root directory or a DICOMDIR)
+ // and whatever the value of parseDir was.
+ // (nothing is cheked in Document constructor, to avoid overhead)
+
+ ParseDir = parseDir;
+ SetLoadMode (0x00000000); // concerns only dicom files
+ Load( fileName );