static bool CollectStressTestSupportedFilesFromDirectory(const WCHAR* dirPath, const WCHAR* filter, WStrVec& paths) { bool hasFiles = false; DirIter di(dirPath); for (const WCHAR* filePath = di.First(); filePath; filePath = di.Next()) { if (IsStressTestSupportedFile(filePath, filter)) { paths.Append(str::Dup(filePath)); hasFiles = true; } } return hasFiles; }
static bool CollectStressTestSupportedFilesFromDirectory(const TCHAR *dirPath, const TCHAR *filter, StrVec& paths) { ScopedMem<TCHAR> pattern(path::Join(dirPath, _T("*"))); WIN32_FIND_DATA fdata; HANDLE hfind = FindFirstFile(pattern, &fdata); if (INVALID_HANDLE_VALUE == hfind) return false; do { if (!(fdata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { if (IsStressTestSupportedFile(fdata.cFileName, filter)) { paths.Append(path::Join(dirPath, fdata.cFileName)); } } } while (FindNextFile(hfind, &fdata)); FindClose(hfind); return paths.Count() > 0; }