/*!*/ public static IEnumerable<string> GlobResults(IFileAdaptionLayer pal, string/*!*/ pattern, int flags) { if (pattern.Length == 0) { yield break; } bool noEscape = ((flags & Constants.FNM_NOESCAPE) != 0); string[] groups = UngroupGlobs(pattern, noEscape); if (groups.Length == 0) { yield break; } foreach (string group in groups) { GlobMatcher matcher = new GlobMatcher(pal, group, flags); foreach (string filename in matcher.DoGlob()) { yield return filename; } } }
internal GlobMatcher(IFileAdaptionLayer pal, string/*!*/ pattern, int flags) { _pal = pal; _pattern = (pattern == "**") ? "*" : pattern; _flags = flags | Constants.FNM_CASEFOLD; _result = new List<string>(); _dirOnly = LastCharacter(pattern) == '/'; _stripTwo = false; }