101 references to PathInternal
System.Private.CoreLib (101)
src\libraries\System.Private.CoreLib\src\System\AppContext.AnyOS.cs (1)
33directory += PathInternal.DirectorySeparatorCharAsString;
src\libraries\System.Private.CoreLib\src\System\IO\Directory.cs (1)
73if (value is not null && value.AsSpan().ContainsAny(PathInternal.DirectorySeparators))
src\libraries\System.Private.CoreLib\src\System\IO\DirectoryInfo.cs (6)
51_name = name = (PathInternal.IsRoot(fullPath) ? 67string? parentName = Path.GetDirectoryName(PathInternal.IsRoot(FullPath.AsSpan()) ? FullPath : Path.TrimEndingDirectorySeparator(FullPath)); 78if (PathInternal.IsEffectivelyEmpty(path.AsSpan())) 89if (trimmedNewPath.StartsWith(trimmedCurrentPath, PathInternal.StringComparison) 91&& ((trimmedNewPath.Length == trimmedCurrentPath.Length) || PathInternal.IsDirectorySeparator(newPath[trimmedCurrentPath.Length]))) 215fullPath: PathInternal.EnsureTrailingSeparator(destination),
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEntry.cs (1)
39if (Path.EndsInDirectorySeparator(OriginalRootDirectory) && PathInternal.StartsWithDirectorySeparator(relativePath))
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEnumerableFactory.cs (1)
103bool ignoreCase = (options.MatchCasing == MatchCasing.PlatformDefault && !PathInternal.IsCaseSensitive)
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (1)
107if (path.Length > 0 && PathInternal.IsDirectorySeparator(path[^1]))
src\libraries\System.Private.CoreLib\src\System\IO\FileInfo.cs (1)
26Debug.Assert(!isNormalized || !PathInternal.IsPartiallyQualified(fullPath.AsSpan()), "should be fully qualified if normalized");
src\libraries\System.Private.CoreLib\src\System\IO\FileSystem.cs (2)
38if (srcNoDirectorySeparator.Equals(destNoDirectorySeparator, PathInternal.StringComparison)) 40if (PathInternal.IsCaseSensitive || // FileNames will be equal because paths are equal.
src\libraries\System.Private.CoreLib\src\System\IO\FileSystem.Unix.cs (9)
286Debug.Assert(PathInternal.IsDirectorySeparator(fullPath[0])); 295ReadOnlySpan<char> path = PathInternal.TrimEndingDirectorySeparator(fullPath.AsSpan()); 325if (PathInternal.IsDirectorySeparator(fullPath[i])) 333Debug.Assert(!PathInternal.IsDirectorySeparator(fullPath[i])); 334while (!PathInternal.IsDirectorySeparator(fullPath[i])) 400Debug.Assert(!isCaseSensitiveRename || !PathInternal.IsCaseSensitive); 430if (!PathInternal.IsCaseSensitive && // handled by isCaseSensitiveRename. 725if (PathInternal.IsPartiallyQualified(linkTarget)) 728sb.Append(PathInternal.DirectorySeparatorChar);
src\libraries\System.Private.CoreLib\src\System\IO\FileSystemInfo.cs (1)
57if (PathInternal.IsDirectorySeparator(ch) || ch == Path.VolumeSeparatorChar)
src\libraries\System.Private.CoreLib\src\System\IO\FileSystemInfo.Unix.cs (1)
24Debug.Assert(!PathInternal.IsPartiallyQualified(fullPath), $"'{fullPath}' should be fully qualified when constructed from directory enumeration");
src\libraries\System.Private.CoreLib\src\System\IO\Path.cs (60)
18public static readonly char DirectorySeparatorChar = PathInternal.DirectorySeparatorChar; 19public static readonly char AltDirectorySeparatorChar = PathInternal.AltDirectorySeparatorChar; 20public static readonly char VolumeSeparatorChar = PathInternal.VolumeSeparatorChar; 21public static readonly char PathSeparator = PathInternal.PathSeparator; 61if (PathInternal.IsDirectorySeparator(ch)) 111if (result && PathInternal.IsDirectorySeparator(fullPath[^1])) 134if (path == null || PathInternal.IsEffectivelyEmpty(path.AsSpan())) 138return end >= 0 ? PathInternal.NormalizeDirectorySeparators(path.Substring(0, end)) : null; 151if (PathInternal.IsEffectivelyEmpty(path)) 160int rootLength = PathInternal.GetRootLength(path); 165while (end > rootLength && !PathInternal.IsDirectorySeparator(path[--end])) ; 168while (end > rootLength && PathInternal.IsDirectorySeparator(path[end - 1])) 209if (PathInternal.IsDirectorySeparator(ch)) 243int i = PathInternal.DirectorySeparatorChar == PathInternal.AltDirectorySeparatorChar ? 244path.LastIndexOf(PathInternal.DirectorySeparatorChar) : 245path.LastIndexOfAny(PathInternal.DirectorySeparatorChar, PathInternal.AltDirectorySeparatorChar); 313return !PathInternal.IsPartiallyQualified(path); 338if (PathInternal.IsDirectorySeparator(ch)) 410if (!PathInternal.IsDirectorySeparator(ch)) 431if (!PathInternal.IsDirectorySeparator(ch)) 433builder.Append(PathInternal.DirectorySeparatorChar); 571if (!PathInternal.IsDirectorySeparator(builder[^1]) && !PathInternal.IsDirectorySeparator(path[0])) 573builder.Append(PathInternal.DirectorySeparatorChar); 602bool needsSeparator = !(EndsInDirectorySeparator(path1) || PathInternal.StartsWithDirectorySeparator(path2)); 630int neededSeparators = EndsInDirectorySeparator(path1) || PathInternal.StartsWithDirectorySeparator(path2) ? 0 : 1; 631bool needsSecondSeparator = !(EndsInDirectorySeparator(path2) || PathInternal.StartsWithDirectorySeparator(path3)); 707bool hasSeparator = PathInternal.IsDirectorySeparator(first[^1]) || PathInternal.IsDirectorySeparator(second[0]); 711string.Concat(first, PathInternal.DirectorySeparatorCharAsString, second); 718bool firstHasSeparator = PathInternal.IsDirectorySeparator(first[^1]) || PathInternal.IsDirectorySeparator(second[0]); 719bool secondHasSeparator = PathInternal.IsDirectorySeparator(second[^1]) || PathInternal.IsDirectorySeparator(third[0]); 723(false, false) => string.Concat(first, PathInternal.DirectorySeparatorCharAsString, second, PathInternal.DirectorySeparatorCharAsString, third), 724(false, true) => string.Concat(first, PathInternal.DirectorySeparatorCharAsString, second, third), 725(true, false) => string.Concat(first, second, PathInternal.DirectorySeparatorCharAsString, third), 740NeedSeparator1 = PathInternal.IsDirectorySeparator(first[^1]) || PathInternal.IsDirectorySeparator(second[0]) ? (byte)0 : (byte)1, 741NeedSeparator2 = PathInternal.IsDirectorySeparator(second[^1]) || PathInternal.IsDirectorySeparator(third[0]) ? (byte)0 : (byte)1, 742NeedSeparator3 = PathInternal.IsDirectorySeparator(third[^1]) || PathInternal.IsDirectorySeparator(fourth[0]) ? (byte)0 : (byte)1, 756destination[0] = PathInternal.DirectorySeparatorChar; 766destination[0] = PathInternal.DirectorySeparatorChar; 776destination[0] = PathInternal.DirectorySeparatorChar; 856return GetRelativePath(relativeTo, path, PathInternal.StringComparison); 864if (PathInternal.IsEffectivelyEmpty(relativeTo.AsSpan())) 866if (PathInternal.IsEffectivelyEmpty(path.AsSpan())) 875if (!PathInternal.AreRootsEqual(relativeTo, path, comparisonType)) 878int commonLength = PathInternal.GetCommonPathLength(relativeTo, path, ignoreCase: comparisonType == StringComparison.OrdinalIgnoreCase); 917if (PathInternal.IsDirectorySeparator(relativeTo[i])) 924else if (PathInternal.IsDirectorySeparator(path[commonLength])) 952public static string TrimEndingDirectorySeparator(string path) => PathInternal.TrimEndingDirectorySeparator(path); 957public static ReadOnlySpan<char> TrimEndingDirectorySeparator(ReadOnlySpan<char> path) => PathInternal.TrimEndingDirectorySeparator(path); 962public static bool EndsInDirectorySeparator(ReadOnlySpan<char> path) => PathInternal.EndsInDirectorySeparator(path); 967public static bool EndsInDirectorySeparator([NotNullWhen(true)] string? path) => PathInternal.EndsInDirectorySeparator(path);
src\libraries\System.Private.CoreLib\src\System\IO\Path.Unix.cs (9)
66string collapsedString = PathInternal.RemoveRelativeSegments(path, PathInternal.GetRootLength(path)); 71string result = collapsedString.Length == 0 ? PathInternal.DirectorySeparatorCharAsString : collapsedString; 91PathInternal.IsDirectorySeparator(path[path.Length - 1]) ? path : 92path + PathInternal.DirectorySeparatorChar; 134return path.StartsWith(PathInternal.DirectorySeparatorChar); 142if (PathInternal.IsEffectivelyEmpty(path)) return null; 143return IsPathRooted(path) ? PathInternal.DirectorySeparatorCharAsString : string.Empty; 148return IsPathRooted(path) ? PathInternal.DirectorySeparatorCharAsString.AsSpan() : ReadOnlySpan<char>.Empty;
src\libraries\System.Private.CoreLib\src\System\Reflection\Assembly.cs (1)
276if (PathInternal.IsPartiallyQualified(path))
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.cs (5)
338if (PathInternal.IsPartiallyQualified(assemblyPath)) 356if (PathInternal.IsPartiallyQualified(nativeImagePath)) 361if (assemblyPath != null && PathInternal.IsPartiallyQualified(assemblyPath)) 442if (PathInternal.IsPartiallyQualified(unmanagedDllPath)) 769if (!exists && PathInternal.IsCaseSensitive)
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.NonAndroid.cs (1)
622tzDirectory += PathInternal.DirectorySeparatorCharAsString;