Asset changes
Add some more System.IO.File wrappers; make public so that it's accessible by the GUI tool.
This commit is contained in:
parent
17f4411ab5
commit
eaec982440
|
@ -5,7 +5,7 @@ using System.IO;
|
|||
|
||||
namespace ScriptTool
|
||||
{
|
||||
internal static class Asset
|
||||
public static class Asset
|
||||
{
|
||||
public static readonly string AssetPath;
|
||||
|
||||
|
@ -14,7 +14,7 @@ namespace ScriptTool
|
|||
AssetPath = AppDomain.CurrentDomain.BaseDirectory;
|
||||
}
|
||||
|
||||
private static string GetFullPath(string path)
|
||||
public static string GetFullPath(string path)
|
||||
=> Path.Combine(AssetPath, path);
|
||||
|
||||
public static string ReadAllText(string path)
|
||||
|
@ -22,5 +22,11 @@ namespace ScriptTool
|
|||
|
||||
public static byte[] ReadAllBytes(string path)
|
||||
=> File.ReadAllBytes(GetFullPath(path));
|
||||
|
||||
public static string[] ReadAllLines(string path)
|
||||
=> File.ReadAllLines(GetFullPath(path));
|
||||
|
||||
public static void WriteAllText(string path, string text)
|
||||
=> File.WriteAllText(GetFullPath(path), text);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue