+2005-01-31 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
+ * src/gdcmDirList.[h|cxx] : add method to find a directory
+ * Test/TestAllReadCompareDicom.cxx : bug fix under Windows
+
2005-01-31 Mathieu Malaterre <Mathieu.Malaterre@creatis.insa-lyon.fr>
* Finish cleaning up my JPEG mess. Should be ok now.
- * Getting toward a RLE very similar to JPEG. Every RLE stuff is now self
+ * Getting toward a RLE very similar to JPEG. Every RLE stuff is now self
contained within the RLE* class(doh!)
2005-01-30 Jean-Pierre Roux <jpr@creatis.univ-lyon1.fr>
Program: gdcm
Module: $RCSfile: TestAllReadCompareDicom.cxx,v $
Language: C++
- Date: $Date: 2005/01/31 03:36:59 $
- Version: $Revision: 1.26 $
+ Date: $Date: 2005/02/01 09:46:15 $
+ Version: $Revision: 1.27 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
+#include "gdcmDirList.h"
#include "gdcmFile.h"
#include "gdcmFileHelper.h"
#include <iostream>
#include <fstream>
+#ifdef _MSC_VER
+ #include <windows.h>
+#endif
+
//Generated file:
#include "gdcmDataImages.h"
////// Check for existence of reference baseline directory
std::string baseLineDir = GDCM_DATA_ROOT;
- baseLineDir += "/BaselineDicom/";
+ baseLineDir += "/BaselineDicom";
- std::ifstream testDIR(baseLineDir.c_str(), std::ios::in | std::ios::binary);
- if (!testDIR )
+ if( !gdcm::DirList::IsDirectory(baseLineDir) )
{
std::cerr << " The reference baseline directory " << std::endl
<< " "
<< std::endl;
return 1;
}
- testDIR.close();
+#ifndef _MSC_VER
+ testDir.close();
+#endif
////// Step 1 (see above description):
std::string filename = GDCM_DATA_ROOT;
std::string referenceFileName = baseLineDir + gdcmDataImages[i++];
std::string::size_type slash_pos = referenceFileName.rfind( "." );
- if ( slash_pos != std::string::npos )
+ if( slash_pos != std::string::npos )
{
referenceFileName.replace( slash_pos + 1, 3, "dcm" );
}
Program: gdcm
Module: $RCSfile: gdcmDirList.cxx,v $
Language: C++
- Date: $Date: 2005/01/18 08:01:41 $
- Version: $Revision: 1.39 $
+ Date: $Date: 2005/02/01 09:46:15 $
+ Version: $Revision: 1.40 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
return numberOfFiles;
}
+
+bool DirList::IsDirectory(std::string const &dirName)
+{
+#ifndef _MSC_VER
+ std::ifstream testDir(dirName.c_str(), std::ios::in | std::ios::binary);
+ return testDir != 0;
+#else
+ return (GetFileAttributes(dirName.c_str()) & FILE_ATTRIBUTE_DIRECTORY) != 0;
+#endif
+}
+
} // end namespace gdcm
//-----------------------------------------------------------------------------
Program: gdcm
Module: $RCSfile: gdcmDirList.h,v $
Language: C++
- Date: $Date: 2005/01/28 17:01:30 $
- Version: $Revision: 1.20 $
+ Date: $Date: 2005/02/01 09:46:15 $
+ Version: $Revision: 1.21 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/// Print all element of the DirList
void Print(std::ostream &os = std::cout);
+ static bool IsDirectory(std::string const &dirName);
+
private :
int Explore(std::string const &dirName, bool recursive=false);