Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
std::vector<std::string> getVmFiles(const boost::filesystem::path& dirToSearch)
{
std::vector<std::string> files;
for (const auto& file : boost::make_iterator_range(boost::filesystem::recursive_directory_iterator{dirToSearch}, {})) {
std::regex vmFile{R"((?:.*).vm)"};
if (boost::filesystem::is_regular_file(file) && std::regex_search(file.path().string().begin(), file.path().string().end(), vmFile)) {
files.emplace_back(file.path().string());
}
}
return files;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.