#include <gdcmDirList.h>
Public Member Functions | |
| gdcmDirList (std::string dirName, bool recursive=false) | |
| virtual | ~gdcmDirList (void) |
| std::string | GetDirName (void) |
Static Public Attributes | |
| const char | SEPARATOR_X = '/' |
| const char | SEPARATOR_WIN = '\\' |
| const std::string | SEPARATOR = "/" |
Private Member Functions | |
| void | NormalizePath (std::string &dirName) |
| void | Explore (std::string dirName, bool recursive=false) |
Private Attributes | |
| std::string | name |
|
||||||||||||
|
Definition at line 35 of file gdcmDirList.cxx. References Explore(), and NormalizePath().
00036 {
00037 name=dirName;
00038
00039 NormalizePath(name);
00040 Explore(name,recursive);
00041 }
|
|
|
Definition at line 48 of file gdcmDirList.cxx.
00049 {
00050 }
|
|
||||||||||||
|
Definition at line 91 of file gdcmDirList.cxx. References NormalizePath(). Referenced by gdcmDirList().
00092 {
00093 std::string fileName;
00094
00095 NormalizePath(dirName);
00096
00097 #ifdef _MSC_VER
00098 WIN32_FIND_DATA fileData;
00099 HANDLE hFile=FindFirstFile((dirName+"*").c_str(),&fileData);
00100 int found=true;
00101
00102 while( (hFile!=INVALID_HANDLE_VALUE) && (found) )
00103 {
00104 fileName=fileData.cFileName;
00105 if(fileData.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
00106 {
00107 if( (fileName!=".") && (fileName!="..") && (recursive) )
00108 Explore(dirName+fileName);
00109 }
00110 else
00111 {
00112 this->push_back(dirName+fileName);
00113 }
00114
00115 found=FindNextFile(hFile,&fileData);
00116 }
00117
00118 #else
00119 struct dirent **namelist;
00120 int n=scandir(dirName.c_str(), &namelist, 0, alphasort);
00121
00122 for (int i= 0;i < n; i++)
00123 {
00124 fileName=namelist[i]->d_name;
00125 if(namelist[i]->d_type==DT_DIR)
00126 {
00127 if( (fileName!=".") && (fileName!="..") && (recursive) )
00128 Explore(dirName+fileName);
00129 }
00130 else
00131 {
00132 this->push_back(dirName+fileName);
00133 }
00134 }
00135 #endif
00136 }
|
|
|
Definition at line 62 of file gdcmDirList.cxx. Referenced by gdcmDicomDir::NewDicomDir().
00063 {
00064 return(name);
00065 }
|
|
|
Definition at line 77 of file gdcmDirList.cxx. References SEPARATOR, SEPARATOR_WIN, and SEPARATOR_X. Referenced by Explore(), and gdcmDirList().
00078 {
00079 int size=dirName.size();
00080 if((dirName[size-1]!=SEPARATOR_X)&&(dirName[size-1]!=SEPARATOR_WIN))
00081 {
00082 dirName+=SEPARATOR;
00083 }
00084 }
|
|
|
Definition at line 28 of file gdcmDirList.h. |
|
|
Definition at line 26 of file gdcmDirList.cxx. Referenced by NormalizePath(). |
|
|
Definition at line 25 of file gdcmDirList.cxx. Referenced by NormalizePath(). |
|
|
Definition at line 24 of file gdcmDirList.cxx. Referenced by NormalizePath(). |
1.3.6