예제 #1
0
        /// <summary>
        /// Implementation of a method in <see cref="IFileSystem"/>
        /// </summary>
        /// <exception cref="NotSupportedException">Thrown if the method has not been overridden by a child class.</exception>
        public virtual string[] GetFiles(string path, string searchPattern, bool topDirectoryOnly)
        {
            var files   = GetItems(path, !topDirectoryOnly);
            var matcher = new Regex(MemoryFileSystem.GetFileSearchRegex(searchPattern), RegexOptions.Compiled);

            return(files.Select(x => x.Key).Where(x => matcher.IsMatch(x)).ToArray());
        }