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:
jeffman 2019-01-08 20:46:50 -05:00
parent 17f4411ab5
commit eaec982440
1 changed files with 8 additions and 2 deletions

View File

@ -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);
}
}