7/20/2018

get file list in the folder (example code)

example code


namespace fs = std::experimental::filesystem;

std::vector<std::string> list_files_in_dir(string dirPath)
{
 vector<string> r;
 
 for (auto & p : fs::directory_iterator(dirPath))
 {
  std::cout << p.path().string() << std::endl;
  r.push_back(p.path().string());
 }
 
 return r;
}