From: malaterre Date: Wed, 17 Sep 2003 17:46:35 +0000 (+0000) Subject: * corrected directory parsing under Win32 X-Git-Tag: Version0.3.1~166 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=0a6fbcbd58d5e186b183316d8d10d1f07ac0f6cb;p=gdcm.git * corrected directory parsing under Win32 --- diff --git a/src/gdcmHeaderHelper.cxx b/src/gdcmHeaderHelper.cxx index 32ada9e5..3b1547e6 100644 --- a/src/gdcmHeaderHelper.cxx +++ b/src/gdcmHeaderHelper.cxx @@ -1,4 +1,4 @@ -// $Header: /cvs/public/gdcm/src/Attic/gdcmHeaderHelper.cxx,v 1.3 2003/09/11 13:44:17 jpr Exp $ +// $Header: /cvs/public/gdcm/src/Attic/gdcmHeaderHelper.cxx,v 1.4 2003/09/17 17:46:35 malaterre Exp $ //This is needed when compiling in debug mode #ifdef _MSC_VER @@ -24,19 +24,22 @@ using namespace std; #include int GetDir(string dPath, list &filenames) { + //For now dPath should have an ending "\" WIN32_FIND_DATA FileData; HANDLE hFile; - hFile = FindFirstFile(dPath.c_str(), &FileData); + hFile = FindFirstFile((dPath+"*").c_str(), &FileData); if ( hFile == INVALID_HANDLE_VALUE ) { //No files ! return false; } - filenames.push_back( FileData.cFileName ); + if( strncmp(FileData.cFileName, ".", 1) != 0 ) + filenames.push_back( dPath+FileData.cFileName ); while( FindNextFile(hFile, &FileData ) != 0) { - filenames.push_back( FileData.cFileName ); + if( strncmp(FileData.cFileName, ".", 1) != 0 ) + filenames.push_back( dPath+FileData.cFileName ); } return true; }