-
Notifications
You must be signed in to change notification settings - Fork 264
Expand file tree
/
Copy pathIPath.cs
More file actions
205 lines (156 loc) · 7.53 KB
/
IPath.cs
File metadata and controls
205 lines (156 loc) · 7.53 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
using System.Diagnostics.CodeAnalysis;
namespace System.IO.Abstractions
{
/// <inheritdoc cref="Path" />
public interface IPath : IFileSystemEntity
{
/// <inheritdoc cref="Path.AltDirectorySeparatorChar" />
char AltDirectorySeparatorChar { get; }
/// <inheritdoc cref="Path.DirectorySeparatorChar" />
char DirectorySeparatorChar { get; }
/// <inheritdoc cref="Path.PathSeparator" />
char PathSeparator { get; }
/// <inheritdoc cref="Path.VolumeSeparatorChar" />
char VolumeSeparatorChar { get; }
/// <inheritdoc cref="Path.ChangeExtension(string, string)" />
[return: NotNullIfNotNull("path")]
string? ChangeExtension(string? path, string? extension);
/// <inheritdoc cref="Path.Combine(string, string)" />
string Combine(string path1, string path2);
/// <inheritdoc cref="Path.Combine(string, string, string)" />
string Combine(string path1, string path2, string path3);
/// <inheritdoc cref="Path.Combine(string, string, string, string)" />
string Combine(string path1, string path2, string path3, string path4);
/// <inheritdoc cref="Path.Combine(string[])" />
string Combine(params string[] paths);
#if FEATURE_PATH_SPAN
/// <inheritdoc cref="Path.Combine(ReadOnlySpan{string})" />
string Combine(params ReadOnlySpan<string> paths);
#endif
#if FEATURE_ENDS_IN_DIRECTORY_SEPARATOR
/// <inheritdoc cref="Path.EndsInDirectorySeparator(ReadOnlySpan{char})" />
bool EndsInDirectorySeparator(ReadOnlySpan<char> path);
/// <inheritdoc cref="Path.EndsInDirectorySeparator(string)" />
bool EndsInDirectorySeparator(string path);
#endif
#if FEATURE_PATH_EXISTS
/// <inheritdoc cref="Path.Exists(string)" />
bool Exists([NotNullWhen(true)] string? path);
#endif
#if FEATURE_ADVANCED_PATH_OPERATIONS
/// <inheritdoc cref="Path.GetDirectoryName(ReadOnlySpan{char})" />
ReadOnlySpan<char> GetDirectoryName(ReadOnlySpan<char> path);
#endif
/// <inheritdoc cref="Path.GetDirectoryName(string)" />
string? GetDirectoryName(string? path);
#if FEATURE_ADVANCED_PATH_OPERATIONS
/// <inheritdoc cref="Path.GetExtension(ReadOnlySpan{char})" />
ReadOnlySpan<char> GetExtension(ReadOnlySpan<char> path);
#endif
/// <inheritdoc cref="Path.GetExtension(string)" />
[return: NotNullIfNotNull("path")]
string? GetExtension(string? path);
#if FEATURE_ADVANCED_PATH_OPERATIONS
/// <inheritdoc cref="Path.GetFileName(ReadOnlySpan{char})" />
ReadOnlySpan<char> GetFileName(ReadOnlySpan<char> path);
#endif
/// <inheritdoc cref="Path.GetFileName(string)" />
[return: NotNullIfNotNull("path")]
string? GetFileName(string? path);
#if FEATURE_ADVANCED_PATH_OPERATIONS
/// <inheritdoc cref="Path.GetFileNameWithoutExtension(ReadOnlySpan{char})" />
ReadOnlySpan<char> GetFileNameWithoutExtension(ReadOnlySpan<char> path);
#endif
/// <inheritdoc cref="Path.GetFileNameWithoutExtension(string)" />
[return: NotNullIfNotNull("path")]
string? GetFileNameWithoutExtension(string? path);
/// <inheritdoc cref="Path.GetFullPath(string)" />
string GetFullPath(string path);
#if FEATURE_ADVANCED_PATH_OPERATIONS
/// <inheritdoc cref="Path.GetFullPath(string, string)" />
string GetFullPath(string path, string basePath);
#endif
/// <inheritdoc cref="Path.GetInvalidFileNameChars()" />
char[] GetInvalidFileNameChars();
/// <inheritdoc cref="Path.GetInvalidPathChars()" />
char[] GetInvalidPathChars();
#if FEATURE_ADVANCED_PATH_OPERATIONS
/// <inheritdoc cref="Path.GetPathRoot(ReadOnlySpan{char})" />
ReadOnlySpan<char> GetPathRoot(ReadOnlySpan<char> path);
#endif
/// <inheritdoc cref="Path.GetPathRoot(string?)" />
string? GetPathRoot(string? path);
/// <inheritdoc cref="Path.GetRandomFileName()" />
string GetRandomFileName();
#if FEATURE_ADVANCED_PATH_OPERATIONS
/// <inheritdoc cref="Path.GetRelativePath(string, string)" />
string GetRelativePath(string relativeTo, string path);
#endif
/// <inheritdoc cref="Path.GetTempFileName()" />
string GetTempFileName();
/// <inheritdoc cref="Path.GetTempPath()" />
string GetTempPath();
#if FEATURE_ADVANCED_PATH_OPERATIONS
/// <inheritdoc cref="Path.HasExtension(ReadOnlySpan{char})" />
bool HasExtension(ReadOnlySpan<char> path);
#endif
/// <inheritdoc cref="Path.HasExtension(string)" />
bool HasExtension([NotNullWhen(true)] string? path);
#if FEATURE_ADVANCED_PATH_OPERATIONS
/// <inheritdoc cref="Path.IsPathFullyQualified(ReadOnlySpan{char})" />
bool IsPathFullyQualified(ReadOnlySpan<char> path);
/// <inheritdoc cref="Path.IsPathFullyQualified(string)" />
bool IsPathFullyQualified(string path);
/// <inheritdoc cref="Path.IsPathRooted(ReadOnlySpan{char})" />
bool IsPathRooted(ReadOnlySpan<char> path);
#endif
/// <inheritdoc cref="Path.IsPathRooted(string?)" />
bool IsPathRooted([NotNullWhen(true)] string? path);
#if FEATURE_PATH_JOIN_WITH_SPAN
/// <inheritdoc cref="Path.Join(ReadOnlySpan{char}, ReadOnlySpan{char})" />
string Join(ReadOnlySpan<char> path1, ReadOnlySpan<char> path2);
/// <inheritdoc cref="Path.Join(ReadOnlySpan{char}, ReadOnlySpan{char}, ReadOnlySpan{char})" />
string Join(ReadOnlySpan<char> path1,
ReadOnlySpan<char> path2,
ReadOnlySpan<char> path3);
#if FEATURE_PATH_SPAN
/// <inheritdoc cref="Path.Join(ReadOnlySpan{string?})" />
string Join(params ReadOnlySpan<string?> paths);
#endif
/// <inheritdoc cref="Path.TryJoin(ReadOnlySpan{char}, ReadOnlySpan{char}, Span{char}, out int)" />
bool TryJoin(ReadOnlySpan<char> path1,
ReadOnlySpan<char> path2,
Span<char> destination,
out int charsWritten);
/// <inheritdoc cref="Path.TryJoin(ReadOnlySpan{char}, ReadOnlySpan{char}, ReadOnlySpan{char}, Span{char}, out int)" />
bool TryJoin(ReadOnlySpan<char> path1,
ReadOnlySpan<char> path2,
ReadOnlySpan<char> path3,
Span<char> destination,
out int charsWritten);
#endif
#if FEATURE_PATH_JOIN_WITH_PARAMS
/// <inheritdoc cref="Path.Join(string, string)" />
string Join(string? path1, string? path2);
/// <inheritdoc cref="Path.Join(string, string, string)" />
string Join(string? path1, string? path2, string? path3);
/// <inheritdoc cref="Path.Join(string[])" />
string Join(params string?[] paths);
#endif
#if FEATURE_ENDS_IN_DIRECTORY_SEPARATOR
/// <inheritdoc cref="Path.TrimEndingDirectorySeparator(ReadOnlySpan{char})" />
ReadOnlySpan<char> TrimEndingDirectorySeparator(ReadOnlySpan<char> path);
/// <inheritdoc cref="Path.TrimEndingDirectorySeparator(string)" />
string TrimEndingDirectorySeparator(string path);
#endif
#if FEATURE_PATH_JOIN_WITH_FOUR_PATHS
/// <inheritdoc cref="Path.Join(ReadOnlySpan{char}, ReadOnlySpan{char}, ReadOnlySpan{char}, ReadOnlySpan{char})" />
string Join(ReadOnlySpan<char> path1,
ReadOnlySpan<char> path2,
ReadOnlySpan<char> path3,
ReadOnlySpan<char> path4);
/// <inheritdoc cref="Path.Join(string, string, string, string)" />
string Join(string? path1, string? path2, string? path3, string? path4);
#endif
}
}