Exemplo n.º 1
0
        public FilesystemSearchResult FindMatches(string includes, string excludes)
        {
            var searchedPaths = GetSearchedPaths();
            var foundPaths    = FilesystemPathsMatcher.MatchSearchResult(includes, excludes, searchedPaths);

            return(new FilesystemSearchResult(searchedPaths, foundPaths));
        }
Exemplo n.º 2
0
        // ---------------
        // Finding results
        // ---------------

        public FilesystemSearchResult FindMatches(string pattern)
        {
            var searchedPaths = GetSearchedPaths();
            var foundPaths    = FilesystemPathsMatcher.MatchSearchResult(pattern, searchedPaths);

            return(new FilesystemSearchResult(searchedPaths, foundPaths));
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        public FilesystemSearchResult ElseFindMatches(string pattern)
        {
            if (FoundPaths.Any())
            {
                return(this);
            }

            var foundPaths = FilesystemPathsMatcher.MatchSearchResult(pattern, this.SearchedPaths);

            return(new FilesystemSearchResult(this.SearchedPaths, foundPaths));
        }
Exemplo n.º 5
0
        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());
        }