public FilesystemSearchResult FindMatches(string includes, string excludes) { var searchedPaths = GetSearchedPaths(); var foundPaths = FilesystemPathsMatcher.MatchSearchResult(includes, excludes, searchedPaths); return(new FilesystemSearchResult(searchedPaths, foundPaths)); }
// --------------- // Finding results // --------------- public FilesystemSearchResult FindMatches(string pattern) { var searchedPaths = GetSearchedPaths(); var foundPaths = FilesystemPathsMatcher.MatchSearchResult(pattern, searchedPaths); return(new FilesystemSearchResult(searchedPaths, foundPaths)); }
public FilesystemSearchResult ElseFindMatches(string includes, string excludes) { if (FoundPaths.Any()) { return(this); } var foundPaths = FilesystemPathsMatcher.MatchSearchResult(includes, excludes, this.SearchedPaths); return(new FilesystemSearchResult(this.SearchedPaths, foundPaths)); }
public FilesystemSearchResult ElseFindMatches(string pattern) { if (FoundPaths.Any()) { return(this); } var foundPaths = FilesystemPathsMatcher.MatchSearchResult(pattern, this.SearchedPaths); return(new FilesystemSearchResult(this.SearchedPaths, foundPaths)); }
private IReadOnlyCollection <FilePath> FilterOutSearchedPaths(IEnumerable <FilePath> filePaths) { if (AllowedExtensions != null) { filePaths = filePaths.Where(path => AllowedExtensions.Contains(path.GetExtension())); } var includedPatternsString = RequiredPatterns != null?string.Join(';', RequiredPatterns) : "*"; var excludedPatternsString = ExcludedPatterns != null?string.Join(';', ExcludedPatterns) : null; filePaths = FilesystemPathsMatcher.MatchSearchResult(includedPatternsString, excludedPatternsString, filePaths); return(filePaths.ToList()); }