Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetPathRoot() [2/2]

static ? string System.IO.Path.GetPathRoot ( string? path)
inlinestatic

Definition at line 1008 of file Path.cs.

1009 {
1010 if (PathInternal.IsEffectivelyEmpty(path.AsSpan()))
1011 {
1012 return null;
1013 }
1014 ReadOnlySpan<char> pathRoot = GetPathRoot(path.AsSpan());
1015 if (path.Length == pathRoot.Length)
1016 {
1017 return PathInternal.NormalizeDirectorySeparators(path);
1018 }
1019 return PathInternal.NormalizeDirectorySeparators(pathRoot.ToString());
1020 }
static ? string GetPathRoot(string? path)
Definition Path.cs:1008

References System.IO.Path.GetPathRoot(), System.IO.PathInternal.IsEffectivelyEmpty(), System.ReadOnlySpan< T >.Length, System.IO.PathInternal.NormalizeDirectorySeparators(), and System.ReadOnlySpan< T >.ToString().

Referenced by System.IO.FileSystem.CreateDirectory(), System.IO.Directory.GetDirectoryRoot(), System.IO.Path.GetFileName(), System.IO.Path.GetFullPath(), System.IO.Path.GetPathRoot(), System.IO.Path.GetVolumeName(), System.IO.Directory.Move(), System.IO.DirectoryInfo.MoveTo(), System.IO.DriveInfoInternal.NormalizeDriveName(), System.IO.FileSystem.ThrowExceptionEncryptDecryptFail(), and System.IO.FileSystemAclExtensions.ValidateFileHandle().