mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-15 04:29:07 +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:
@@ -97,6 +97,8 @@ public sealed class InMemoryFileSystem : IFileSystem
|
||||
return this;
|
||||
}
|
||||
|
||||
public bool IgnoresCase => _comparison == StringComparison.OrdinalIgnoreCase;
|
||||
|
||||
public bool FileExists(string path) => _files.ContainsKey(Normalize(path));
|
||||
|
||||
/// <summary>A link counts as the directory it points at, as the disk has it.</summary>
|
||||
|
||||
Reference in New Issue
Block a user