Changes

Jump to navigation Jump to search
→‎File paths: update for SMAPI 3.7 release
Line 137: Line 137:  
{{SMAPI upcoming|3.7}}
 
{{SMAPI upcoming|3.7}}
   −
<tt>PathUtilities</tt> provides utility methods for working with file paths, complementing the <tt>Path</tt> class provided by .NET:
+
<tt>PathUtilities</tt> provides utility methods for working with file paths and [[Modding:Modder Guide/APIs/Content|asset names]], complementing the <tt>Path</tt> class provided by .NET:
    
{| class="wikitable"
 
{| class="wikitable"
Line 157: Line 157:  
| Get whether a string can be used as a 'slug', containing only basic characters that are safe in all contexts (e.g. filenames, URLs, SMAPI IDs, etc).
 
| Get whether a string can be used as a 'slug', containing only basic characters that are safe in all contexts (e.g. filenames, URLs, SMAPI IDs, etc).
 
|-
 
|-
| <code>NormalizePathSeparators</code>
+
| <code>NormalizePath</code>
| Normalize directory separators to match the format used by the current OS. For example:
+
| Normalize file paths or asset names to match the format used by the current OS. For example:
   −
<source lang="c#">string path = PathUtilities.NormalizePathSeparators("Characters/Dialogue/Abigail");
+
<source lang="c#">string path = PathUtilities.NormalizePathSeparators(@"Characters\Dialogue//Abigail");
 
// Linux/Mac: "Characters/Dialogue/Abigail"
 
// Linux/Mac: "Characters/Dialogue/Abigail"
 
// Windows: "Characters\Dialogue\Abigail"
 
// Windows: "Characters\Dialogue\Abigail"
 
</source>
 
</source>
 
|}
 
|}
  −
This is also useful for working with
      
===Semantic versions===
 
===Semantic versions===
translators
8,404

edits

Navigation menu