Rev. | 86e26ecde9d36b0074e6fb8a2a2b26250bb81d51 |
---|---|
Tamaño | 1,297 octetos |
Tiempo | 2022-11-30 01:06:13 |
Autor | yoshy |
Log Message | [MOD] UserDialogProxy の名前空間を UI 配下から UI.Dialog 配下に移動
|
using System.IO;
using System.Linq;
namespace CleanAuLait48.Core.IO
{
public static class PathHelper
{
public static readonly string RELATIVE_PATH_CURRENT = ".";
public static readonly string RELATIVE_PATH_UPWARDS = "..";
public static string CreateCanonicalPath(params string[] paths)
{
if (paths.Any(path => string.IsNullOrEmpty(path)))
{
return null;
}
return CreateCanonicalPath(Path.Combine(paths));
}
public static string CreateCanonicalPath(string path)
{
if (string.IsNullOrEmpty(path))
{
return null;
}
return Path.GetFullPath(path);
}
public static string EnsureLeadingDotPath(string relativePath)
{
return relativePath == RELATIVE_PATH_CURRENT
? relativePath
: Path.Combine(RELATIVE_PATH_CURRENT, relativePath);
}
public static string EnsureEndingDirectorySeparator(string path)
{
if (!path.EndsWith(Path.DirectorySeparatorChar.ToString()))
{
return path + Path.DirectorySeparatorChar;
}
return path;
}
}
}