Добавьте файлы проекта.
This commit is contained in:
23
SQLLinter/Infrastructure/Parser/ParsingUtility.cs
Normal file
23
SQLLinter/Infrastructure/Parser/ParsingUtility.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Text;
|
||||
|
||||
namespace SQLLinter.Infrastructure.Parser
|
||||
{
|
||||
public static class ParsingUtility
|
||||
{
|
||||
public static TextReader CreateTextReaderFromString(string str)
|
||||
{
|
||||
var bytes = Encoding.UTF8.GetBytes(str);
|
||||
return new StreamReader(new MemoryStream(bytes));
|
||||
}
|
||||
|
||||
public static Stream GenerateStreamFromString(string s)
|
||||
{
|
||||
var stream = new MemoryStream();
|
||||
var writer = new StreamWriter(stream);
|
||||
writer.Write(s);
|
||||
writer.Flush();
|
||||
stream.Position = 0;
|
||||
return stream;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user