slang/text/Glob.h file

File name pattern globbing.


namespace slang
Root namespace.


enum class GlobRank { ExactPath, SimpleName, WildcardName, Directory }
Classifies the ranking of a glob pattern.
enum class GlobMode { Files, Directories }
The type of search to perform with a file system glob operation.


auto svGlob(const std::filesystem::path& basePath, std::string_view pattern, GlobMode mode, SmallVector<std::filesystem::path>& results, bool expandEnvVars, std::error_code& ec) -> GlobRank
Performs a file system "glob" operation to find paths matching the given pattern.
auto svGlobMatches(const std::filesystem::path& path, const std::filesystem::path& pattern) -> bool
Checks whether the given path matches the supplied pattern.