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