-/*
- * \ingroup gdcmDicomDir
- * \brief Constructor : Parses recursively the directory and creates the DicomDir
- * \ or uses an already built DICOMDIR, depending on 'parseDir' value
- * @param Name name of the root directory (parseDir = true)
- * name of the DICOMDIR (parseDir = false)
- * @param parseDir - true if user passed an entry point
- * and wants to explore recursively the directories
- * - false if user passed an already built DICOMDIR file
- * and wants to use it
- * @param exception_on_error whether we want to throw an exception or not
- */
-gdcmDicomDir::gdcmDicomDir(const char *Name, bool parseDir,
- bool exception_on_error):
- gdcmParser(Name,exception_on_error,true) // true : enable SeQuences
-{
- // 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(Name)==1 && Name[0]=='.') { // user passed '.' as Name
- // we get current directory name
- char*dummy=(char*) malloc(1000); // TODO : check with Windoze // JPR
- 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