@@ -84,6 +84,29 @@ public interface IFileSystem
84
84
/// </returns>
85
85
IEnumerable < string > EnumerateFiles ( string path , string searchPattern ) ;
86
86
87
+ /// <summary>
88
+ /// Returns an enumerable collection of directory full names in a specified path.
89
+ /// </summary>
90
+ /// <param name="path">The relative or absolute path to the directory to search. This string is not case-sensitive.</param>
91
+ /// <returns>
92
+ /// An enumerable collection of the full names (including paths) for the directories
93
+ /// in the directory specified by path.
94
+ /// </returns>
95
+ IEnumerable < string > EnumerateDirectories ( string path ) ;
96
+
97
+ /// <summary>
98
+ /// Opens a text file, reads all the text in the file, and then closes the file
99
+ /// </summary>
100
+ /// <param name="path">The file to open for reading.</param>
101
+ /// <returns>A string containing all the text in the file.</returns>
102
+ string ReadAllText ( string path ) ;
103
+
104
+ /// <summary>
105
+ /// Opens a text file, reads all lines of the file, and then closes the file.
106
+ /// </summary>
107
+ /// <param name="path">The file to open for reading.</param>
108
+ /// <returns>A string array containing all lines of the file.</returns>
109
+ string [ ] ReadAllLines ( string path ) ;
87
110
}
88
111
89
112
/// <summary>
@@ -111,5 +134,11 @@ public Stream OpenFileStream(string path, FileMode fileMode, FileAccess fileAcce
111
134
public void DeleteFile ( string path ) => File . Delete ( path ) ;
112
135
113
136
public IEnumerable < string > EnumerateFiles ( string path , string searchPattern ) => Directory . EnumerateFiles ( path , searchPattern ) ;
137
+
138
+ public IEnumerable < string > EnumerateDirectories ( string path ) => Directory . EnumerateDirectories ( path ) ;
139
+
140
+ public string ReadAllText ( string path ) => File . ReadAllText ( path ) ;
141
+
142
+ public string [ ] ReadAllLines ( string path ) => File . ReadAllLines ( path ) ;
114
143
}
115
144
}
0 commit comments