Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
FileSystemEnumerable.cs
Go to the documentation of this file.
4
6
8{
10
12
13 private sealed class DelegateEnumerator : FileSystemEnumerator<TResult>
14 {
16
18 : base(enumerable._directory, isNormalized, enumerable._options)
19 {
20 _enumerable = enumerable;
21 }
22
24 {
25 return _enumerable._transform(ref entry);
26 }
27
29 {
30 return _enumerable.ShouldRecursePredicate?.Invoke(ref entry) ?? true;
31 }
32
34 {
35 return _enumerable.ShouldIncludePredicate?.Invoke(ref entry) ?? true;
36 }
37 }
38
40
41 private readonly FindTransform _transform;
42
43 private readonly EnumerationOptions _options;
44
45 private readonly string _directory;
46
48
50
52 : this(directory, transform, options, isNormalized: false)
53 {
54 }
55
57 {
58 _directory = directory ?? throw new ArgumentNullException("directory");
59 _transform = transform ?? throw new ArgumentNullException("transform");
62 }
63
65 {
66 return Interlocked.Exchange(ref _enumerator, null) ?? new DelegateEnumerator(this, isNormalized: false);
67 }
68
73}
static EnumerationOptions Default
override bool ShouldRecurseIntoEntry(ref FileSystemEntry entry)
DelegateEnumerator(FileSystemEnumerable< TResult > enumerable, bool isNormalized)
override TResult TransformEntry(ref FileSystemEntry entry)
FileSystemEnumerable(string directory, FindTransform transform, EnumerationOptions? options=null)
delegate TResult FindTransform(ref FileSystemEntry entry)
FileSystemEnumerable(string directory, FindTransform transform, EnumerationOptions options, bool isNormalized)
delegate bool FindPredicate(ref FileSystemEntry entry)
static int Exchange(ref int location1, int value)
new IEnumerator< T > GetEnumerator()