EP 0.1.1
This commit is contained in:
@@ -11,7 +11,7 @@ namespace Convention
|
|||||||
{
|
{
|
||||||
private string FullPath;
|
private string FullPath;
|
||||||
private FileSystemInfo OriginInfo;
|
private FileSystemInfo OriginInfo;
|
||||||
private FileStream OriginControlStream;
|
public FileStream OriginControlStream { get; private set; }
|
||||||
public ToolFile(string path)
|
public ToolFile(string path)
|
||||||
{
|
{
|
||||||
FullPath = path;
|
FullPath = path;
|
||||||
|
32
Convention/[Symbolization]/Reader/Reader.cs
Normal file
32
Convention/[Symbolization]/Reader/Reader.cs
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Convention.Symbolization.Internal
|
||||||
|
{
|
||||||
|
internal class Reader
|
||||||
|
{
|
||||||
|
private ToolFile FileCore;
|
||||||
|
|
||||||
|
public Reader(string file)
|
||||||
|
{
|
||||||
|
FileCore = new(file);
|
||||||
|
if (FileCore.Exists() == false)
|
||||||
|
throw new FileNotFoundException($"{file} not exists");
|
||||||
|
FileCore.Open(FileMode.Open);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SymbolizationContext BuildContext()
|
||||||
|
{
|
||||||
|
SymbolizationContext context = new();
|
||||||
|
using StreamReader reader = new(FileCore.OriginControlStream);
|
||||||
|
for (; reader.EndOfStream==false;)
|
||||||
|
{
|
||||||
|
var line = reader.ReadLine();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
57
Convention/[Symbolization]/Symbolization.cs
Normal file
57
Convention/[Symbolization]/Symbolization.cs
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Convention.Symbolization
|
||||||
|
{
|
||||||
|
public sealed class SymbolizationContext
|
||||||
|
{
|
||||||
|
public SymbolizationContext() { }
|
||||||
|
public SymbolizationContext(SymbolizationContext forward)
|
||||||
|
{
|
||||||
|
ParentContext = forward;
|
||||||
|
}
|
||||||
|
|
||||||
|
private readonly SymbolizationContext ParentContext;
|
||||||
|
|
||||||
|
public void Execute(string commandsBlock)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public sealed class SymbolizationCore
|
||||||
|
{
|
||||||
|
internal SymbolizationCore(Internal.Reader reader)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public SymbolizationContext Context { get; private set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Symbolization
|
||||||
|
{
|
||||||
|
public static SymbolizationCore Build(string file)
|
||||||
|
{
|
||||||
|
return new SymbolizationCore(new(file));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static SymbolizationContext Execute(string commandsBlock)
|
||||||
|
{
|
||||||
|
SymbolizationContext context = new();
|
||||||
|
context.Execute(commandsBlock);
|
||||||
|
return context;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static SymbolizationContext Execute(SymbolizationContext forward,string commandsBlock)
|
||||||
|
{
|
||||||
|
SymbolizationContext context = new(forward);
|
||||||
|
context.Execute(commandsBlock);
|
||||||
|
return context;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user