-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStatistics.cs
More file actions
82 lines (71 loc) · 1.9 KB
/
Copy pathStatistics.cs
File metadata and controls
82 lines (71 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
namespace LineEndingNormalizer;
/// <summary>
/// Collects processing statistics.
///
/// All increments use <see cref="Interlocked"/> since files may be
/// processed concurrently.
/// </summary>
internal sealed class Statistics
{
private int _checked;
private int _converted;
private int _unchanged;
private int _skipped;
private int _errors;
/// <summary>
/// Gets the number of matching files processed.
/// </summary>
public int Checked => _checked;
/// <summary>
/// Gets the number of modified files.
/// </summary>
public int Converted => _converted;
/// <summary>
/// Gets the number of unchanged files.
/// </summary>
public int Unchanged => _unchanged;
/// <summary>
/// Gets the number of files skipped because their encoding
/// could not be determined.
/// </summary>
public int Skipped => _skipped;
/// <summary>
/// Gets the number of files that could not be processed.
/// </summary>
public int Errors => _errors;
/// <summary>
/// Increments the number of processed files.
/// </summary>
public void IncrementChecked()
{
Interlocked.Increment(ref _checked);
}
/// <summary>
/// Increments the number of modified files.
/// </summary>
public void IncrementConverted()
{
Interlocked.Increment(ref _converted);
}
/// <summary>
/// Increments the number of unchanged files.
/// </summary>
public void IncrementUnchanged()
{
Interlocked.Increment(ref _unchanged);
}
/// <summary>
/// Increments the number of skipped files.
/// </summary>
public void IncrementSkipped()
{
Interlocked.Increment(ref _skipped);
}
/// <summary>
/// Increments the number of failed files.
/// </summary>
public void IncrementErrors()
{
Interlocked.Increment(ref _errors);
}
}