diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2020-08-20 23:40:50 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2020-08-20 23:40:50 -0400 |
| commit | 3af4c218c0e70167db23a6303d2af30aff37d2fe (patch) | |
| tree | 927f29edcf54ab562f40f3d1c6cb69287c7f5980 /Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/Util/FileSystemUtil.cs | |
| parent | b6daed0af784f4e9bc13329dd87c671b06ee1c65 (diff) | |
| download | Project-Sandbox-3af4c218c0e70167db23a6303d2af30aff37d2fe.tar.gz Project-Sandbox-3af4c218c0e70167db23a6303d2af30aff37d2fe.tar.bz2 Project-Sandbox-3af4c218c0e70167db23a6303d2af30aff37d2fe.zip | |
Removed a bunch of stuff; Changes
Diffstat (limited to 'Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/Util/FileSystemUtil.cs')
| -rw-r--r-- | Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/Util/FileSystemUtil.cs | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/Util/FileSystemUtil.cs b/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/Util/FileSystemUtil.cs deleted file mode 100644 index 1ee32cc..0000000 --- a/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/Util/FileSystemUtil.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System;
-using System.ComponentModel;
-using System.IO;
-using System.Text;
-using JetBrains.Annotations;
-using UnityEngine;
-
-namespace Packages.Rider.Editor.Util
-{
- public static class FileSystemUtil
- {
- [NotNull]
- public static string GetFinalPathName([NotNull] string path)
- {
- if (path == null) throw new ArgumentNullException("path");
-
- // up to MAX_PATH. MAX_PATH on Linux currently 4096, on Mac OS X 1024
- // doc: http://man7.org/linux/man-pages/man3/realpath.3.html
- var sb = new StringBuilder(8192);
- var result = LibcNativeInterop.realpath(path, sb);
- if (result == IntPtr.Zero)
- {
- throw new Win32Exception($"{path} was not resolved.");
- }
-
- return new FileInfo(sb.ToString()).FullName;
- }
-
- public static string FileNameWithoutExtension(string path)
- {
- if (string.IsNullOrEmpty(path))
- {
- return "";
- }
-
- var indexOfDot = -1;
- var indexOfSlash = 0;
- for (var i = path.Length - 1; i >= 0; i--)
- {
- if (indexOfDot == -1 && path[i] == '.')
- {
- indexOfDot = i;
- }
-
- if (indexOfSlash == 0 && path[i] == '/' || path[i] == '\\')
- {
- indexOfSlash = i + 1;
- break;
- }
- }
-
- if (indexOfDot == -1)
- {
- indexOfDot = path.Length;
- }
-
- return path.Substring(indexOfSlash, indexOfDot - indexOfSlash);
- }
-
- public static bool EditorPathExists(string editorPath)
- {
- return SystemInfo.operatingSystemFamily == OperatingSystemFamily.MacOSX && new DirectoryInfo(editorPath).Exists
- || SystemInfo.operatingSystemFamily != OperatingSystemFamily.MacOSX && new FileInfo(editorPath).Exists;
- }
- }
-}
\ No newline at end of file |
