summaryrefslogtreecommitdiff
path: root/src/SMAPI.Toolkit/Utilities/PathLookups/MinimalPathLookup.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-05-04 20:35:08 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-05-04 20:35:08 -0400
commitc1342bd4cd6b75b24d11275bdd73ebf893f916ea (patch)
tree3c647582d242cbb6abc71ae7bbbbd14c63ce6558 /src/SMAPI.Toolkit/Utilities/PathLookups/MinimalPathLookup.cs
parent42bf82d870ab744f13197ad781b7529a959861e1 (diff)
downloadSMAPI-c1342bd4cd6b75b24d11275bdd73ebf893f916ea.tar.gz
SMAPI-c1342bd4cd6b75b24d11275bdd73ebf893f916ea.tar.bz2
SMAPI-c1342bd4cd6b75b24d11275bdd73ebf893f916ea.zip
disable case-insensitive paths by default pending performance rework
Diffstat (limited to 'src/SMAPI.Toolkit/Utilities/PathLookups/MinimalPathLookup.cs')
-rw-r--r--src/SMAPI.Toolkit/Utilities/PathLookups/MinimalPathLookup.cs31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/SMAPI.Toolkit/Utilities/PathLookups/MinimalPathLookup.cs b/src/SMAPI.Toolkit/Utilities/PathLookups/MinimalPathLookup.cs
new file mode 100644
index 00000000..2cf14704
--- /dev/null
+++ b/src/SMAPI.Toolkit/Utilities/PathLookups/MinimalPathLookup.cs
@@ -0,0 +1,31 @@
+namespace StardewModdingAPI.Toolkit.Utilities.PathLookups
+{
+ /// <summary>An API for relative path lookups within a root directory with minimal preprocessing.</summary>
+ internal class MinimalPathLookup : IFilePathLookup
+ {
+ /*********
+ ** Accessors
+ *********/
+ /// <summary>A singleton instance for reuse.</summary>
+ public static readonly MinimalPathLookup Instance = new();
+
+
+ /*********
+ ** Public methods
+ *********/
+ /// <inheritdoc />
+ public string GetFilePath(string relativePath)
+ {
+ return PathUtilities.NormalizePath(relativePath);
+ }
+
+ /// <inheritdoc />
+ public string GetAssetName(string relativePath)
+ {
+ return PathUtilities.NormalizeAssetName(relativePath);
+ }
+
+ /// <inheritdoc />
+ public void Add(string relativePath) { }
+ }
+}