PageRenderTime 104ms CodeModel.GetById 60ms app.highlight 5ms RepoModel.GetById 36ms app.codeStats 0ms

/src/LinFu.Reflection/DefaultDirectoryLister.cs

http://github.com/philiplaureano/LinFu
C# | 23 lines | 12 code | 1 blank | 10 comment | 0 complexity | fd25e467855c334dba132197c6b67c33 MD5 | raw file
 1using System.Collections.Generic;
 2using System.IO;
 3
 4namespace LinFu.Reflection
 5{
 6    /// <summary>
 7    ///     A class that lists the contents of a given directory.
 8    /// </summary>
 9    internal class DefaultDirectoryLister : IDirectoryListing
10    {
11        /// <summary>
12        ///     Returns a list of files that match the <paramref name="searchPattern" />
13        ///     from the given directory <paramref name="path" />.
14        /// </summary>
15        /// <param name="path">The target directory to search.</param>
16        /// <param name="searchPattern">The search string to match against the names of the files in the <paramref name="path" />.</param>
17        /// <returns>The list of files that match the <paramref name="path" /> and <paramref name="searchPattern" /></returns>
18        public IEnumerable<string> GetFiles(string path, string searchPattern)
19        {
20            return Directory.GetFiles(path, searchPattern);
21        }
22    }
23}