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

How do I find all .exe files using the boost library?

本文关键字:exe 文件 查找 何使用 boost      更新时间:2023-10-16

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

例如:

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

您可以使用directory_迭代器:

#include <boost/filesystem.hpp>
using namespace std;
using namespace boost::filesystem;
...
path mypath("/where/ever/");
for(directory_iterator it( mypath ); ; ++it) {
    ...
}

并符合您的标准。