Skip to content

Commit 01239e5

Browse files
committed
Extracted interface IScannerWorker.
1 parent bc67ff6 commit 01239e5

File tree

2 files changed

+31
-18
lines changed

2 files changed

+31
-18
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using System.Collections.Generic;
2+
using System.Threading;
3+
using ReClassNET.MemoryScanner.Comparer;
4+
5+
namespace ReClassNET.MemoryScanner
6+
{
7+
internal interface IScannerWorker
8+
{
9+
/// <summary>
10+
/// Uses the <see cref="IScanComparer"/> to scan the byte array for results.
11+
/// </summary>
12+
/// <param name="data">The data to scan.</param>
13+
/// <param name="count">The length of the <paramref name="data"/> parameter.</param>
14+
/// <param name="ct">The <see cref="CancellationToken"/> to stop the scan.</param>
15+
/// <returns>An enumeration of all <see cref="ScanResult"/>s.</returns>
16+
IList<ScanResult> Search(byte[] data, int count, CancellationToken ct);
17+
18+
/// <summary>
19+
/// Uses the <see cref="IScanComparer"/> to scan the byte array for results.
20+
/// The comparer uses the provided previous results to compare to the current value.
21+
/// </summary>
22+
/// <param name="data">The data to scan.</param>
23+
/// <param name="count">The length of the <paramref name="data"/> parameter.</param>
24+
/// <param name="previousResults">The previous results to use.</param>
25+
/// <param name="ct">The <see cref="CancellationToken"/> to stop the scan.</param>
26+
/// <returns>An enumeration of all <see cref="ScanResult"/>s.</returns>
27+
IList<ScanResult> Search(byte[] data, int count, IEnumerable<ScanResult> previousResults, CancellationToken ct);
28+
}
29+
}

ReClass.NET/MemoryScanner/ScannerWorker.cs

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Diagnostics.Contracts;
44
using System.Threading;
55
using ReClassNET.MemoryScanner.Comparer;
66

77
namespace ReClassNET.MemoryScanner
88
{
9-
internal class ScannerWorker
9+
internal class ScannerWorker : IScannerWorker
1010
{
1111
private readonly ScanSettings settings;
1212
private readonly IScanComparer comparer;
@@ -20,13 +20,6 @@ public ScannerWorker(ScanSettings settings, IScanComparer comparer)
2020
this.comparer = comparer;
2121
}
2222

23-
/// <summary>
24-
/// Uses the <see cref="IScanComparer"/> to scan the byte array for results.
25-
/// </summary>
26-
/// <param name="data">The data to scan.</param>
27-
/// <param name="count">The length of the <paramref name="data"/> parameter.</param>
28-
/// <param name="ct">The <see cref="CancellationToken"/> to stop the scan.</param>
29-
/// <returns>An enumeration of all <see cref="ScanResult"/>s.</returns>
3023
public IList<ScanResult> Search(byte[] data, int count, CancellationToken ct)
3124
{
3225
Contract.Requires(data != null);
@@ -53,15 +46,6 @@ public IList<ScanResult> Search(byte[] data, int count, CancellationToken ct)
5346
return results;
5447
}
5548

56-
/// <summary>
57-
/// Uses the <see cref="IScanComparer"/> to scan the byte array for results.
58-
/// The comparer uses the provided previous results to compare to the current value.
59-
/// </summary>
60-
/// <param name="data">The data to scan.</param>
61-
/// <param name="count">The length of the <paramref name="data"/> parameter.</param>
62-
/// <param name="previousResults">The previous results to use.</param>
63-
/// <param name="ct">The <see cref="CancellationToken"/> to stop the scan.</param>
64-
/// <returns>An enumeration of all <see cref="ScanResult"/>s.</returns>
6549
public IList<ScanResult> Search(byte[] data, int count, IEnumerable<ScanResult> previousResults, CancellationToken ct)
6650
{
6751
Contract.Requires(data != null);

0 commit comments

Comments
 (0)