mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-09-27 02:13:36 +00:00
18 lines
745 B
C#
18 lines
745 B
C#
|
|
namespace AIStudio.Tools;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Shared rules for comparing file system paths.
|
||
|
|
/// </summary>
|
||
|
|
public static class PathTools
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// How to compare file system paths: Windows treats them case-insensitively, Linux and
|
||
|
|
/// macOS do not. There, two files may differ in casing alone.
|
||
|
|
/// </summary>
|
||
|
|
public static readonly StringComparison COMPARISON = OperatingSystem.IsWindows() ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// The comparer matching <see cref="COMPARISON"/>, for path-keyed lookups.
|
||
|
|
/// </summary>
|
||
|
|
public static readonly StringComparer COMPARER = OperatingSystem.IsWindows() ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal;
|
||
|
|
}
|