Open
Description
While this library works as advertized.. (Thanks!), may I suggest to add a couple of bool functions which match a glob pattern or a vector of glob patterns against a given std::filesystem::path
:
This is useful when one already has a pre-existing recursive filesystem iterator or algorithm.
This is a 'naive' implementation based on the pre-existing fnmatch
function:
bool match(fs::path name, std::vector<std::string> patterns)
{
for (auto& p : patterns) {
if (glob::fnmatch(name, p)) {
return true;
}
}
return false;
}
};
Metadata
Metadata
Assignees
Labels
No labels