diff options
author | Jiyoung Yun <jy910.yun@samsung.com> | 2017-02-10 20:35:12 +0900 |
---|---|---|
committer | Jiyoung Yun <jy910.yun@samsung.com> | 2017-02-10 20:35:12 +0900 |
commit | 4b11dc566a5bbfa1378d6266525c281b028abcc8 (patch) | |
tree | b48831a898906734f8884d08b6e18f1144ee2b82 /src/mscorlib/corefx/System/IO/PathInternal.Unix.cs | |
parent | db20f3f1bb8595633a7e16c8900fd401a453a6b5 (diff) | |
download | coreclr-4b11dc566a5bbfa1378d6266525c281b028abcc8.tar.gz coreclr-4b11dc566a5bbfa1378d6266525c281b028abcc8.tar.bz2 coreclr-4b11dc566a5bbfa1378d6266525c281b028abcc8.zip |
Imported Upstream version 1.0.0.9910upstream/1.0.0.9910
Diffstat (limited to 'src/mscorlib/corefx/System/IO/PathInternal.Unix.cs')
-rw-r--r-- | src/mscorlib/corefx/System/IO/PathInternal.Unix.cs | 42 |
1 files changed, 12 insertions, 30 deletions
diff --git a/src/mscorlib/corefx/System/IO/PathInternal.Unix.cs b/src/mscorlib/corefx/System/IO/PathInternal.Unix.cs index 6c39f99556..08dc1d0251 100644 --- a/src/mscorlib/corefx/System/IO/PathInternal.Unix.cs +++ b/src/mscorlib/corefx/System/IO/PathInternal.Unix.cs @@ -10,11 +10,15 @@ namespace System.IO /// <summary>Contains internal path helpers that are shared between many projects.</summary> internal static partial class PathInternal { + internal const char DirectorySeparatorChar = '/'; + internal const char AltDirectorySeparatorChar = '/'; + internal const char VolumeSeparatorChar = '/'; + internal const char PathSeparator = ':'; + + internal const string DirectorySeparatorCharAsString = "/"; + // There is only one invalid path character in Unix private const char InvalidPathChar = '\0'; - internal static char[] GetInvalidPathChars() => new char[] { InvalidPathChar }; - - internal static readonly int MaxComponentLength = Interop.Sys.MaxName; internal const string ParentDirectoryPrefix = @"../"; @@ -34,24 +38,8 @@ namespace System.IO { // The alternate directory separator char is the same as the directory separator, // so we only need to check one. - Debug.Assert(Path.DirectorySeparatorChar == Path.AltDirectorySeparatorChar); - return c == Path.DirectorySeparatorChar; - } - - /// <summary> - /// Returns true if the path is too long - /// </summary> - internal static bool IsPathTooLong(string fullPath) - { - return fullPath.Length >= Interop.Sys.MaxPath; - } - - /// <summary> - /// Returns true if the directory is too long - /// </summary> - internal static bool IsDirectoryTooLong(string fullPath) - { - return fullPath.Length >= Interop.Sys.MaxPath; + Debug.Assert(DirectorySeparatorChar == AltDirectorySeparatorChar); + return c == DirectorySeparatorChar; } /// <summary> @@ -101,15 +89,9 @@ namespace System.IO { // The directory separator, volume separator, and the alternate directory // separator should be the same on Unix, so we only need to check one. - Debug.Assert(Path.DirectorySeparatorChar == Path.AltDirectorySeparatorChar); - Debug.Assert(Path.DirectorySeparatorChar == Path.VolumeSeparatorChar); - return ch == Path.DirectorySeparatorChar; - } - - internal static bool HasInvalidVolumeSeparator(string path) - { - // This is only ever true for Windows - return false; + Debug.Assert(DirectorySeparatorChar == AltDirectorySeparatorChar); + Debug.Assert(DirectorySeparatorChar == VolumeSeparatorChar); + return ch == DirectorySeparatorChar; } internal static bool IsPartiallyQualified(string path) |