52 lines
No EOL
1.3 KiB
C#
52 lines
No EOL
1.3 KiB
C#
using System.IO;
|
|
using JD.Core.ProjectManaging;
|
|
|
|
|
|
namespace JD.Core
|
|
{
|
|
/// <summary>
|
|
/// Allows to manipulate the root folder value.
|
|
/// </summary>
|
|
public static class DataRoot
|
|
{
|
|
|
|
#region Properties
|
|
|
|
/// <summary>
|
|
/// Gets the name of the data root directory for UAF.
|
|
/// </summary>
|
|
public static string Value => DataPath.Value;
|
|
|
|
/// <summary>
|
|
/// The world folder in the data root.
|
|
/// </summary>
|
|
public static string World => Path.Combine(Value, "World");
|
|
|
|
/// <summary>
|
|
/// Returns a relative path from an absolute filename in data.
|
|
/// </summary>
|
|
public static bool ExtractRelativePath(string fileName, out string relative)
|
|
{
|
|
return DataPath.ExtractRelativePath(fileName, out relative);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Appends the data root to a relative filename.
|
|
/// </summary>
|
|
public static string ToAbsolutePath(string fileName)
|
|
{
|
|
return DataPath.GetAbsolutePath(fileName);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Get the relative path of an absolute path
|
|
/// </summary>
|
|
public static string ToRelativePath(string absolutePath)
|
|
{
|
|
return DataPath.GetRelativePath(absolutePath);
|
|
}
|
|
|
|
#endregion
|
|
|
|
}
|
|
} |