The library Boost.Filesystem makes it easy to work with files and directories. Paths Paths can be build by passing a string to the constructor of boost::filesystem::path. None of the constructors of boost::filesystem::path validate paths or check whe…
Intro. Boost的filesystem可以用来扫描给定目录下的所有项. 实现 具体实现代码如下: 需要包含的头文件和使用的命名空间: #include <boost/filesystem.hpp> using namespace boost::filesystem; 扫描目录下文件的代码: for (directory_iterator dit(your_path); dit != directory_iterator(); dit++){ if (is_regular_file(*d…