getAllResultFiles(std::string path, std::vector<std::string>& files)
{
struct _finddata_t fileinfo;
intptr_t hFile = _findfirst(path.append("\\*").c_str(), &fileinfo);
if (hFile == -1) {
return;
}
do
{
if (fileinfo.attrib & _A_SUBDIR)
{
//if ((strcmp(fileinfo.name, ".") != 0) && (strcmp(fileinfo.name, "..") != 0))//忽略.或..
//{
//目录
//}
}
else//文件
{
files.push_back(fileinfo.name);
}
} while (_findnext(hFile, &fileinfo) == 0);
_findclose(hFile);
}
网友评论