Definition at line 19 of file DirectoryInfo.cpp. References Clear(), CopyWinFindData(), DirectoryInfo(), mAutoScanSubDirs, mFiles, mFilter, mInfo, mName, mSubDirs, and Scan(). Referenced by Scan(). 00020 { 00021 Clear(); 00022 WIN32_FIND_DATA data; 00023 HANDLE h; 00024 std::string pattern(mName); 00025 if(pattern.size() > 0) 00026 pattern.append("/"); 00027 pattern.append(mFilter); 00028 00029 h = FindFirstFile(pattern.c_str(), &data); 00030 if (h != INVALID_HANDLE_VALUE) 00031 { 00032 do 00033 { 00034 std::string filename(data.cFileName); 00035 if(filename == ".") 00036 CopyWinFindData(&mInfo, &data); 00037 if(filename != "." && filename != "..") 00038 { 00039 if(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) 00040 { 00041 DirectoryInfo* child; 00042 if(mName[mName.length()-1] != '/' && mName[mName.length()-1] != '\\') 00043 child = new DirectoryInfo(mName + "/" + filename, filename); 00044 else 00045 child = new DirectoryInfo(mName + filename, filename); 00046 if(mAutoScanSubDirs) 00047 child->Scan(); 00048 mSubDirs.push_back(child); 00049 } 00050 else 00051 mFiles.push_back(new Util::FileInfo(filename, this)); 00052 } 00053 } 00054 while(FindNextFile(h, &data)); 00055 } 00056 FindClose(h); 00057 }
Here is the call graph for this function:
|