Commit 3e99d7f
authored
refactor: improve and consolidate interfaces (#906)
Make the following changes for the interfaces:
1. Enable [Nullable reference types](https://learn.microsoft.com/en-us/dotnet/csharp/nullable-references)
2. Improve and cleanup XML documentation and sort properties and methods in interfaces alphabetically
3. Consolidate the naming in the factory methods to always use just `New`; so instead of `new DirectoryInfo(path)` you should use `IFileSystem.DirectoryInfo.New(path)`. The previous existing factory methods were kept and marked as `Obsolete`.
4. Added a `Wrap` method to the factory interfaces that can be used instead of a direct cast (which is not possible for interfaces) to create a wrapped interface from a "System.IO" type.
5. Removed the `WriteAllLinesAsync` with array overload, as it is not defined in `System.IO` and overload resolution will automatically use the `IEnumerable` overload.
6. Added missing methods: `ResolveLinkTarget` and `CreateAsSymbolicLink`
7. Change the return type for Stream-Methods to a custom defined `FileSystemStream`.
*Note: This should fix the issues from #793 , right?*
Added the following extensibility measures:
- Add `IFileSystem FileSystem` property to more classes to enable implementing extension methods.
This was simplified by adding a base interface `IFileSystemExtensionPoint`
- Add a `IFileSystemExtensibility Extensibility` property on `IFileSystemInfo` and `IFileSystemStream` which grants access to the underlying wrapped instance or to a metadata dictionary to store additional information together with the instance.1 parent 8a24fd2 commit 3e99d7f
File tree
87 files changed
+2098
-796
lines changed- benchmarks/System.IO.Abstractions.Benchmarks/Support
- src
- System.IO.Abstractions.TestingHelpers
- TestableIO.System.IO.Abstractions.Wrappers
- TestableIO.System.IO.Abstractions
- tests
- System.IO.Abstractions.TestingHelpers.Tests
- TestableIO.System.IO.Abstractions.Wrappers.Tests
- __snapshots__
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
87 files changed
+2098
-796
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
Lines changed: 49 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | | - | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | | - | |
| 30 | + | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | | - | |
| 34 | + | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| |||
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
58 | | - | |
| 61 | + | |
| 62 | + | |
59 | 63 | | |
60 | 64 | | |
61 | 65 | | |
| |||
136 | 140 | | |
137 | 141 | | |
138 | 142 | | |
139 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
140 | 146 | | |
141 | 147 | | |
142 | 148 | | |
| |||
231 | 237 | | |
232 | 238 | | |
233 | 239 | | |
234 | | - | |
| 240 | + | |
| 241 | + | |
235 | 242 | | |
236 | 243 | | |
237 | 244 | | |
| |||
331 | 338 | | |
332 | 339 | | |
333 | 340 | | |
334 | | - | |
| 341 | + | |
| 342 | + | |
335 | 343 | | |
336 | 344 | | |
337 | | - | |
| 345 | + | |
| 346 | + | |
338 | 347 | | |
339 | 348 | | |
340 | 349 | | |
| |||
358 | 367 | | |
359 | 368 | | |
360 | 369 | | |
361 | | - | |
362 | | - | |
363 | | - | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
364 | 374 | | |
365 | 375 | | |
366 | 376 | | |
| |||
389 | 399 | | |
390 | 400 | | |
391 | 401 | | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
392 | 411 | | |
393 | 412 | | |
394 | 413 | | |
| |||
434 | 453 | | |
435 | 454 | | |
436 | 455 | | |
437 | | - | |
| 456 | + | |
| 457 | + | |
438 | 458 | | |
439 | 459 | | |
440 | 460 | | |
| |||
469 | 489 | | |
470 | 490 | | |
471 | 491 | | |
472 | | - | |
| 492 | + | |
| 493 | + | |
473 | 494 | | |
474 | | - | |
| 495 | + | |
| 496 | + | |
475 | 497 | | |
476 | 498 | | |
477 | 499 | | |
| |||
505 | 527 | | |
506 | 528 | | |
507 | 529 | | |
508 | | - | |
| 530 | + | |
| 531 | + | |
509 | 532 | | |
510 | 533 | | |
511 | 534 | | |
| |||
520 | 543 | | |
521 | 544 | | |
522 | 545 | | |
523 | | - | |
| 546 | + | |
| 547 | + | |
524 | 548 | | |
525 | 549 | | |
526 | 550 | | |
527 | 551 | | |
528 | 552 | | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
529 | 562 | | |
530 | 563 | | |
531 | 564 | | |
| |||
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
41 | 49 | | |
42 | 50 | | |
43 | 51 | | |
| |||
52 | 60 | | |
53 | 61 | | |
54 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
55 | 71 | | |
56 | 72 | | |
57 | 73 | | |
| |||
337 | 353 | | |
338 | 354 | | |
339 | 355 | | |
340 | | - | |
| 356 | + | |
341 | 357 | | |
342 | 358 | | |
343 | 359 | | |
| |||
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
16 | 22 | | |
17 | 23 | | |
18 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
19 | 37 | | |
20 | 38 | | |
21 | 39 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
Lines changed: 18 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
| |||
42 | 46 | | |
43 | 47 | | |
44 | 48 | | |
45 | | - | |
| 49 | + | |
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
52 | 69 | | |
53 | 70 | | |
54 | 71 | | |
| |||
Lines changed: 0 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | 88 | | |
101 | 89 | | |
102 | 90 | | |
| |||
0 commit comments