Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added directory enumeration

  • Loading branch information...
commit 219d9e5361645af6fc95865685b8683ba168142a 1 parent 2af5abe
estoy authored
View
4 src/ScriptCs.Contracts/IFileSystem.cs
@@ -8,6 +8,10 @@ public interface IFileSystem
{
IEnumerable<string> EnumerateFiles(string dir, string search, SearchOption searchOption = SearchOption.AllDirectories);
+ IEnumerable<string> EnumerateDirectories(string dir, string searchPattern, SearchOption searchOption = SearchOption.AllDirectories);
+
+ IEnumerable<string> EnumerateFilesAndDirectories(string dir, string searchPattern, SearchOption searchOption = SearchOption.AllDirectories);
+
void Copy(string source, string dest, bool overwrite);
bool DirectoryExists(string path);
View
10 src/ScriptCs.Core/FileSystem.cs
@@ -13,6 +13,16 @@ public virtual IEnumerable<string> EnumerateFiles(string dir, string searchPatte
return Directory.EnumerateFiles(dir, searchPattern, searchOption);
}
+ public virtual IEnumerable<string> EnumerateDirectories(string dir, string searchPattern, SearchOption searchOption = SearchOption.AllDirectories)
+ {
+ return Directory.EnumerateDirectories(dir, searchPattern, searchOption);
+ }
+
+ public virtual IEnumerable<string> EnumerateFilesAndDirectories(string dir, string searchPattern, SearchOption searchOption = SearchOption.AllDirectories)
+ {
+ return Directory.EnumerateFileSystemEntries(dir, searchPattern, searchOption);
+ }
+
public virtual void Copy(string source, string dest, bool overwrite)
{
File.Copy(source, dest, overwrite);

0 comments on commit 219d9e5

Please sign in to comment.
Something went wrong with that request. Please try again.