File tree 1 file changed +14
-0
lines changed
src/PowerShellEditorServices/Utility
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,11 @@ internal static class PathUtils
30
30
/// </summary>
31
31
internal static readonly char AlternatePathSeparator = RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) ? '/' : '\\ ' ;
32
32
33
+ /// <summary>
34
+ /// The <see cref="StringComparison" /> value to be used when comparing paths. Will be
35
+ /// <see cref="StringComparison.Ordinal" /> for case sensitive file systems and <see cref="StringComparison.OrdinalIgnoreCase" />
36
+ /// in case insensitive file systems.
37
+ /// </summary>
33
38
internal static readonly StringComparison PathComparison = RuntimeInformation . IsOSPlatform ( OSPlatform . Linux )
34
39
? StringComparison . Ordinal
35
40
: StringComparison . OrdinalIgnoreCase ;
@@ -41,6 +46,15 @@ internal static class PathUtils
41
46
/// <returns>The normalized path.</returns>
42
47
public static string NormalizePathSeparators ( string path ) => string . IsNullOrWhiteSpace ( path ) ? path : path . Replace ( AlternatePathSeparator , DefaultPathSeparator ) ;
43
48
49
+ /// <summary>
50
+ /// Determines whether two specified strings represent the same path.
51
+ /// </summary>
52
+ /// <param name="left">The first path to compare, or <see langword="null" />.</param>
53
+ /// <param name="right">The second path to compare, or <see langword="null" />.</param>
54
+ /// <returns>
55
+ /// <see langword="true" /> if the value of <paramref name="left" /> represents the same
56
+ /// path as the value of <paramref name="right" />; otherwise, <see langword="false" />.
57
+ /// </returns>
44
58
internal static bool IsPathEqual ( string left , string right )
45
59
{
46
60
if ( string . IsNullOrEmpty ( left ) )
You can’t perform that action at this time.
0 commit comments