diff options
| author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-09-03 18:36:39 -0400 |
|---|---|---|
| committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-09-03 18:36:39 -0400 |
| commit | c5b8cd626489dad6210fe629658314dfc85f4d08 (patch) | |
| tree | 3e30c3172e6c0bb3e422036581684593156fad22 /src/SMAPI/Utilities | |
| parent | 4ee96a20bb6c74bc7ff6176a03e7f15d47cddfa8 (diff) | |
| parent | 6d4ea7f0bd584602632e6e308d52bb369b30006f (diff) | |
| download | SMAPI-c5b8cd626489dad6210fe629658314dfc85f4d08.tar.gz SMAPI-c5b8cd626489dad6210fe629658314dfc85f4d08.tar.bz2 SMAPI-c5b8cd626489dad6210fe629658314dfc85f4d08.zip | |
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/Utilities')
| -rw-r--r-- | src/SMAPI/Utilities/PathUtilities.cs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/SMAPI/Utilities/PathUtilities.cs b/src/SMAPI/Utilities/PathUtilities.cs index 19f16ea9..541b163c 100644 --- a/src/SMAPI/Utilities/PathUtilities.cs +++ b/src/SMAPI/Utilities/PathUtilities.cs @@ -7,6 +7,13 @@ namespace StardewModdingAPI.Utilities public static class PathUtilities { /********* + ** Accessors + *********/ + /// <summary>The preferred directory separator character in an asset key.</summary> + public static char PreferredAssetSeparator { get; } = ToolkitPathUtilities.PreferredAssetSeparator; + + + /********* ** Public methods *********/ /// <summary>Get the segments from a path (e.g. <c>/usr/bin/example</c> => <c>usr</c>, <c>bin</c>, and <c>example</c>).</summary> @@ -18,8 +25,16 @@ namespace StardewModdingAPI.Utilities return ToolkitPathUtilities.GetSegments(path, limit); } - /// <summary>Normalize separators in a file path.</summary> + /// <summary>Normalize an asset name to match how MonoGame's content APIs would normalize and cache it.</summary> + /// <param name="assetName">The asset name to normalize.</param> + public static string NormalizeAssetName(string assetName) + { + return ToolkitPathUtilities.NormalizeAssetName(assetName); + } + + /// <summary>Normalize separators in a file path for the current platform.</summary> /// <param name="path">The file path to normalize.</param> + /// <remarks>This should only be used for file paths. For asset names, use <see cref="NormalizeAssetName"/> instead.</remarks> [Pure] public static string NormalizePath(string path) { |
