13
13
14
14
namespace Flow . Launcher . Plugin . Explorer . Search . Everything
15
15
{
16
-
17
16
public static class EverythingApi
18
17
{
19
-
20
18
private const int BufferSize = 4096 ;
21
19
22
20
private static SemaphoreSlim _semaphore = new ( 1 , 1 ) ;
21
+
23
22
// cached buffer to remove redundant allocations.
24
23
private static readonly StringBuilder buffer = new ( BufferSize ) ;
25
24
@@ -35,46 +34,6 @@ public enum StateCode
35
34
InvalidCallError
36
35
}
37
36
38
- /// <summary>
39
- /// Gets or sets a value indicating whether [match path].
40
- /// </summary>
41
- /// <value><c>true</c> if [match path]; otherwise, <c>false</c>.</value>
42
- public static bool MatchPath
43
- {
44
- get => EverythingApiDllImport . Everything_GetMatchPath ( ) ;
45
- set => EverythingApiDllImport . Everything_SetMatchPath ( value ) ;
46
- }
47
-
48
- /// <summary>
49
- /// Gets or sets a value indicating whether [match case].
50
- /// </summary>
51
- /// <value><c>true</c> if [match case]; otherwise, <c>false</c>.</value>
52
- public static bool MatchCase
53
- {
54
- get => EverythingApiDllImport . Everything_GetMatchCase ( ) ;
55
- set => EverythingApiDllImport . Everything_SetMatchCase ( value ) ;
56
- }
57
-
58
- /// <summary>
59
- /// Gets or sets a value indicating whether [match whole word].
60
- /// </summary>
61
- /// <value><c>true</c> if [match whole word]; otherwise, <c>false</c>.</value>
62
- public static bool MatchWholeWord
63
- {
64
- get => EverythingApiDllImport . Everything_GetMatchWholeWord ( ) ;
65
- set => EverythingApiDllImport . Everything_SetMatchWholeWord ( value ) ;
66
- }
67
-
68
- /// <summary>
69
- /// Gets or sets a value indicating whether [enable regex].
70
- /// </summary>
71
- /// <value><c>true</c> if [enable regex]; otherwise, <c>false</c>.</value>
72
- public static bool EnableRegex
73
- {
74
- get => EverythingApiDllImport . Everything_GetRegex ( ) ;
75
- set => EverythingApiDllImport . Everything_SetRegex ( value ) ;
76
- }
77
-
78
37
/// <summary>
79
38
/// Checks whether the sort option is Fast Sort.
80
39
/// </summary>
@@ -95,7 +54,7 @@ public static async ValueTask<bool> IsEverythingRunningAsync(CancellationToken t
95
54
96
55
try
97
56
{
98
- EverythingApiDllImport . Everything_GetMajorVersion ( ) ;
57
+ EverythingApiDllImport . Everything_GetMajorVersion ( ) ;
99
58
var result = EverythingApiDllImport . Everything_GetLastError ( ) != StateCode . IPCError ;
100
59
return result ;
101
60
}
@@ -122,7 +81,7 @@ public static async IAsyncEnumerable<SearchResult> SearchAsync(EverythingSearchO
122
81
123
82
await _semaphore . WaitAsync ( token ) ;
124
83
125
-
84
+
126
85
try
127
86
{
128
87
if ( token . IsCancellationRequested )
@@ -152,6 +111,7 @@ public static async IAsyncEnumerable<SearchResult> SearchAsync(EverythingSearchO
152
111
EverythingApiDllImport . Everything_SetMax ( option . MaxCount ) ;
153
112
154
113
EverythingApiDllImport . Everything_SetSort ( option . SortOption ) ;
114
+ EverythingApiDllImport . Everything_SetMatchPath ( option . IsFullPathSearch ) ;
155
115
156
116
if ( token . IsCancellationRequested ) yield break ;
157
117
0 commit comments