Skip to content

Commit

Permalink
Add doc comments to new PathUtils members
Browse files Browse the repository at this point in the history
  • Loading branch information
SeeminglyScience committed Aug 16, 2022
1 parent eb9069d commit 03f503f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/PowerShellEditorServices/Utility/PathUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ internal static class PathUtils
/// </summary>
internal static readonly char AlternatePathSeparator = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? '/' : '\\';

/// <summary>
/// The <see cref="StringComparison" /> value to be used when comparing paths. Will be
/// <see cref="StringComparison.Ordinal" /> for case sensitive file systems and <see cref="StringComparison.OrdinalIgnoreCase" />
/// in case insensitive file systems.
/// </summary>
internal static readonly StringComparison PathComparison = RuntimeInformation.IsOSPlatform(OSPlatform.Linux)
? StringComparison.Ordinal
: StringComparison.OrdinalIgnoreCase;
Expand All @@ -41,6 +46,15 @@ internal static class PathUtils
/// <returns>The normalized path.</returns>
public static string NormalizePathSeparators(string path) => string.IsNullOrWhiteSpace(path) ? path : path.Replace(AlternatePathSeparator, DefaultPathSeparator);

/// <summary>
/// Determines whether two specified strings represent the same path.
/// </summary>
/// <param name="left">The first path to compare, or <see langword="null" />.</param>
/// <param name="right">The second path to compare, or <see langword="null" />.</param>
/// <returns>
/// <see langword="true" /> if the value of <paramref name="left" /> represents the same
/// path as the value of <paramref name="right" />; otherwise, <see langword="false" />.
/// </returns>
internal static bool IsPathEqual(string left, string right)
{
if (string.IsNullOrEmpty(left))
Expand Down

0 comments on commit 03f503f

Please sign in to comment.