【发布时间】:2012-02-02 06:19:56
【问题描述】:
你能否使用 boost::filesystem 和 BOOST_FOREACH 遍历目录中的所有文件? 我试过了
path dirPath = ...
int fileCount = 0;
BOOST_FOREACH(const path& filePath, dirPath)
if(is_regular_file(filePath))
++fileCount;
此代码可以编译、运行,但不会产生所需的结果。
【问题讨论】:
标签: c++ boost boost-filesystem boost-foreach