mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-17 22:15:59 +01:00
refactor: share the case-insensitive lookup of data files
The scenery repository's include lookup becomes CaseInsensitivePaths, which takes any folder over IFileSystem and gives a name as it is on disk. Of folders named alike in other case it now tries each, not only the first. A name is joined to the folder as the simulator joins it, a leading slash counting for nothing. IFileSystem tells whether the disk ignores case; there, as on Windows, a name missed as written is not looked for any further, so no folder is listed.
This commit is contained in:
@@ -10,6 +10,9 @@ public sealed class PhysicalFileSystem : IFileSystem
|
||||
{
|
||||
public const string TempSuffix = ".starter.tmp";
|
||||
|
||||
// Their disks as they come; a Linux one tells case apart.
|
||||
public bool IgnoresCase { get; } = OperatingSystem.IsWindows() || OperatingSystem.IsMacOS();
|
||||
|
||||
public bool FileExists(string path) => File.Exists(path);
|
||||
|
||||
public bool DirectoryExists(string path) => Directory.Exists(path);
|
||||
|
||||
Reference in New Issue
Block a user