|
2 | 2 |
|
3 | 3 | <!-- A description of the package and where one can find more documentation --> |
4 | 4 |
|
5 | | - |
| 5 | +Provides support for matching file system names/paths using [glob patterns](https://en.wikipedia.org/wiki/Glob_(programming)). |
6 | 6 |
|
7 | 7 | ## Key Features |
8 | 8 |
|
9 | 9 | <!-- The key features of this package --> |
10 | 10 |
|
11 | | -* |
12 | | -* |
13 | | -* |
| 11 | +* Contains the `Matcher` type, which can be used to match files in the file system based on user-defined patterns. |
14 | 12 |
|
15 | 13 | ## How to Use |
16 | 14 |
|
17 | 15 | <!-- A compelling example on how to use this package with code, as well as any specific guidelines for when to use the package --> |
18 | 16 |
|
| 17 | +Get all matching files: |
| 18 | + |
| 19 | +```c# |
| 20 | +using Microsoft.Extensions.FileSystemGlobbing; |
| 21 | + |
| 22 | +Matcher matcher = new(); |
| 23 | +matcher.AddIncludePatterns(new[] { "*.txt", "*.asciidoc", "*.md" }); |
| 24 | + |
| 25 | +string searchDirectory = "../starting-folder/"; |
| 26 | + |
| 27 | +IEnumerable<string> matchingFiles = matcher.GetResultsInFullPath(searchDirectory); |
| 28 | + |
| 29 | +// Use matchingFiles if there are any found. |
| 30 | +// The files in this collection are fully qualified file system paths. |
| 31 | +``` |
| 32 | + |
19 | 33 | ## Main Types |
20 | 34 |
|
21 | 35 | <!-- The main types provided in this library --> |
22 | 36 |
|
23 | 37 | The main types provided by this library are: |
24 | 38 |
|
25 | | -* `` |
26 | | -* `` |
27 | | -* `` |
| 39 | +* `Microsoft.Extensions.FileSystemGlobbing.Matcher` |
28 | 40 |
|
29 | | -## Addtional Documentation |
| 41 | +## Additional Documentation |
30 | 42 |
|
31 | 43 | <!-- Links to further documentation. Remove conceptual documentation if not available for the library. --> |
32 | 44 |
|
33 | | -* [Conceptual documentation](https://learn.microsoft.com/en-us/dotnet/standard/serialization/**LIBRARYNAME**/overview) |
34 | | -* [API documentation](https://learn.microsoft.com/en-us/dotnet/api/**LIBRARYNAME**) |
35 | | - |
36 | | -## Related Packages |
37 | | - |
38 | | -<!-- The related packages associated with this package --> |
| 45 | +* [Conceptual documentation](https://learn.microsoft.com/en-us/dotnet/core/extensions/file-globbing) |
| 46 | +* [API documentation](https://learn.microsoft.com/dotnet/api/microsoft.extensions.filesystemglobbing) |
39 | 47 |
|
40 | 48 | ## Feedback & Contributing |
41 | 49 |
|
|
0 commit comments