Class FastDirectoryEnumerator
A fast enumerator of files in a directory. Use this if you need to get attributes for all files in a directory.
Inheritance
Inherited Members
Namespace:uFrame.Editor.Core
Assembly:cs.temp.dll.dll
Syntax
public class FastDirectoryEnumerator
Remarks
This enumerator is substantially faster than using
Methods
| Improve this DocEnumerateFiles(String)
Gets FileData for all the files in a directory.
Declaration
public static IEnumerable<FileData> EnumerateFiles(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path to search. |
Returns
Type | Description |
---|---|
IEnumerable<FileData> | An object that implements |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | path is a null reference (Nothing in VB) |
EnumerateFiles(String, String)
Gets FileData for all the files in a directory that match a specific filter.
Declaration
public static IEnumerable<FileData> EnumerateFiles(string path, string searchPattern)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path to search. |
System.String | searchPattern | The search string to match against files in the path. |
Returns
Type | Description |
---|---|
IEnumerable<FileData> | An object that implements |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | path is a null reference (Nothing in VB) |
System.ArgumentNullException | filter is a null reference (Nothing in VB) |
EnumerateFiles(String, String, SearchOption)
Gets FileData for all the files in a directory that match a specific filter, optionally including all sub directories.
Declaration
public static IEnumerable<FileData> EnumerateFiles(string path, string searchPattern, SearchOption searchOption)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path to search. |
System.String | searchPattern | The search string to match against files in the path. |
SearchOption | searchOption | One of the SearchOption values that specifies whether the search operation should include all subdirectories or only the current directory. |
Returns
Type | Description |
---|---|
IEnumerable<FileData> | An object that implements |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | path is a null reference (Nothing in VB) |
System.ArgumentNullException | filter is a null reference (Nothing in VB) |
System.ArgumentOutOfRangeException | searchOption is not one of the valid values of the System.IO.SearchOption enumeration. |
GetFiles(String, String, SearchOption)
Gets FileData for all the files in a directory that match a specific filter.
Declaration
public static FileData[] GetFiles(string path, string searchPattern, SearchOption searchOption)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path to search. |
System.String | searchPattern | The search string to match against files in the path. |
SearchOption | searchOption |
Returns
Type | Description |
---|---|
FileData[] | An object that implements |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | path is a null reference (Nothing in VB) |
System.ArgumentNullException | filter is a null reference (Nothing in VB) |