Add glob_list_t::add_glob which can be used both for include and exclude

This commit is contained in:
Allan Odgaard
2016-09-14 08:35:24 +02:00
parent 28b9fadb63
commit 30e04eb72a
2 changed files with 9 additions and 4 deletions

View File

@@ -47,16 +47,20 @@ namespace path
// = glob_list_t =
// ===============
void glob_list_t::add_include_glob (std::string const& glob, size_t itemType)
void glob_list_t::add_glob (std::string const& glob, size_t itemType)
{
if(glob != NULL_STR)
_globs.emplace_back(glob_t(glob, false), itemType);
_globs.emplace_back(glob_t(glob, itemType & kPathItemExclude), itemType);
}
void glob_list_t::add_include_glob (std::string const& glob, size_t itemType)
{
add_glob(glob, itemType);
}
void glob_list_t::add_exclude_glob (std::string const& glob, size_t itemType)
{
if(glob != NULL_STR)
_globs.emplace_back(glob_t(glob, true), itemType | kPathItemExclude);
add_glob(glob, itemType | kPathItemExclude);
}
bool glob_list_t::include (std::string const& path, size_t itemType, bool defaultResult) const

View File

@@ -33,6 +33,7 @@ namespace path
add_include_glob(glob);
}
void add_glob (std::string const& glob, size_t itemType = kPathItemAny);
void add_include_glob (std::string const& glob, size_t itemType = kPathItemAny);
void add_exclude_glob (std::string const& glob, size_t itemType = kPathItemAny);