]> Creatis software - gdcm.git/blobdiff - src/gdcmDirList.cxx
ENH: Add Example stuff with real main:
[gdcm.git] / src / gdcmDirList.cxx
index 203c0a5f11b8cb31912e819e60061baa383e75fa..5f8f3ccc2536bb4eb548efe2ed4dced09dec67a3 100644 (file)
@@ -6,27 +6,18 @@
 #include <iostream>
 #include <algorithm>
 
-#ifdef GDCM_NO_ANSI_STRING_STREAM
-   #include <strstream>
-   #define  ostringstream ostrstream
-#else
-   #include <sstream>
-#endif
-
-#ifdef _MSC_VER 
+#if defined(_MSC_VER) || defined (__CYGWIN__)
    #include <windows.h> 
+#ifdef _MSC_VER
    #include <direct.h>
+#endif //_MSC_VER
 #else
    #include <dirent.h>   
    #include <unistd.h>
 #endif
 
-// ================= WARNING 
-// ================= DOXYGEN DOESN'T WORK FOR THIS FILE ?!?
-// =================
-
 // Constructor / Destructor
-/*
+/**
  * \ingroup gdcmDirList
  * \brief Constructor  
  * @param  dirName root directory name
 gdcmDirList::gdcmDirList(std::string dirName,bool recursive)
 {
    name=dirName;
-
    NormalizePath(name);
    Explore(name,recursive);
 }
 
-/*
+/**
  * \ingroup gdcmDirList
  * \brief  Destructor
  */
@@ -53,7 +43,7 @@ gdcmDirList::~gdcmDirList(void)
 
 //-----------------------------------------------------------------------------
 // Public
-/*
+/**
  * \ingroup gdcmDirList
  * \brief   Get the directory name
  * @return the directory name 
@@ -69,7 +59,7 @@ std::string gdcmDirList::GetDirName(void)
 //-----------------------------------------------------------------------------
 // Private
 
-/*
+/**
  * \ingroup gdcmDirList
  * \brief   Explore a directory with possibility of recursion
  * @param  dirName directory to explore
@@ -80,8 +70,7 @@ void gdcmDirList::Explore(std::string dirName,bool recursive)
    std::string fileName;
 
    NormalizePath(dirName);
-
-#ifdef _MSC_VER 
+#if defined(_MSC_VER) || (__CYGWIN__)
    WIN32_FIND_DATA fileData; 
    HANDLE hFile=FindFirstFile((dirName+"*").c_str(),&fileData);
    int found=true;
@@ -108,7 +97,7 @@ void gdcmDirList::Explore(std::string dirName,bool recursive)
 
    for (int i= 0;i < n; i++) 
    {
-      fileName=namelist[i]->d_name;
+      fileName=namelist[i]->d_name;     
       if(namelist[i]->d_type==DT_DIR)
       {
          if( (fileName!=".") && (fileName!="..") && (recursive) )