30 if (filter.empty() || str.empty())
33 auto filterItr = filter.begin();
34 auto filterEnd = filter.end();
35 auto strItr = str.begin();
36 auto strEnd = str.end();
39 while (filterItr != filterEnd && strItr != strEnd)
41 if (*filterItr ==
'*')
43 if (++filterItr == filterEnd)
46 while (*filterItr != *strItr)
53 else if (*filterItr != *strItr)
60 return (filterItr == filterEnd || (*filterItr ==
'*' && filterItr + 1 == filterEnd)) && strItr == strEnd;
70 boost::filesystem::file_type type = boost::filesystem::regular_file, std::string_view filter =
"*"sv)
72 boost::system::error_code ec;
73 boost::filesystem::directory_iterator dirItr(dirpath, ec);
77 for (boost::filesystem::directory_entry
const& dirEntry : dirItr)
79 if (dirEntry.status(ec).type() != type || ec)
82 std::string fileName = dirEntry.path().filename().string();
86 fileList.push_back(std::move(fileName));
ListFilesResult getDirContents(std::vector< std::string > &fileList, boost::filesystem::path const &dirpath, boost::filesystem::file_type type=boost::filesystem::regular_file, std::string_view filter="*"sv)