You've already forked com.unity.ide.cursor
mirror of
https://github.com/boxqkrtm/com.unity.ide.cursor.git
synced 2026-05-15 14:50:08 +00:00
31 lines
696 B
C#
31 lines
696 B
C#
|
|
using System.IO;
|
||
|
|
using System.Text;
|
||
|
|
|
||
|
|
namespace Microsoft.Unity.VisualStudio.Editor
|
||
|
|
{
|
||
|
|
public interface IFileIO
|
||
|
|
{
|
||
|
|
bool Exists(string fileName);
|
||
|
|
|
||
|
|
string ReadAllText(string fileName);
|
||
|
|
void WriteAllText(string fileName, string content);
|
||
|
|
}
|
||
|
|
|
||
|
|
class FileIOProvider : IFileIO
|
||
|
|
{
|
||
|
|
public bool Exists(string fileName)
|
||
|
|
{
|
||
|
|
return File.Exists(fileName);
|
||
|
|
}
|
||
|
|
|
||
|
|
public string ReadAllText(string fileName)
|
||
|
|
{
|
||
|
|
return File.ReadAllText(fileName);
|
||
|
|
}
|
||
|
|
|
||
|
|
public void WriteAllText(string fileName, string content)
|
||
|
|
{
|
||
|
|
File.WriteAllText(fileName, content, Encoding.UTF8);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|