如何使用boost库找到所有.exe文件?

时间:2012-02-10 02:07:22

标签: c++ boost

什么是与FindFirstFile类似的提升功能?我想在使用boost的文件夹中找到*.exe

例如:

HANDLE handle = FindFirstfile(buf, &finds);
while(FindNextFile(handle, &finds) { // using file }

1 个答案:

答案 0 :(得分:0)

你可以使用directory_iterator:

#include <boost/filesystem.hpp>
using namespace std;
using namespace boost::filesystem;

...

path mypath("/where/ever/");

for(directory_iterator it( mypath ); ; ++it) {
    ...
}

并符合您的标准。