first commit
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
namespace SingularityGroup.HotReload.Editor.Util
|
||||
{
|
||||
internal static class FileSystemUtil
|
||||
{
|
||||
|
||||
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 (path[i] == '/' || path[i] == '\\')
|
||||
{
|
||||
indexOfSlash = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (indexOfDot == -1)
|
||||
{
|
||||
indexOfDot = path.Length;
|
||||
}
|
||||
|
||||
return path.Substring(indexOfSlash, indexOfDot - indexOfSlash);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 20b02f00e1547df45ab6ce84acc5dd0c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,14 @@
|
||||
using System.IO;
|
||||
|
||||
namespace SingularityGroup.HotReload.Editor.Util
|
||||
{
|
||||
internal static class StringUtils
|
||||
{
|
||||
public static string NormalizePath(this string path)
|
||||
{
|
||||
return path.Replace(Path.DirectorySeparatorChar == '\\'
|
||||
? '/'
|
||||
: '\\', Path.DirectorySeparatorChar);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5418a9e29385f45488b32d5459ec2c7a
|
||||
timeCreated: 1623056718
|
||||
Reference in New Issue
Block a user