42 lines
1.0 KiB
C#
42 lines
1.0 KiB
C#
using SQLLinter.Common.Helpers;
|
|
using SQLLinter.Core.Interfaces;
|
|
using SQLLinter.Infrastructure.Diagram;
|
|
using SQLLinter.Infrastructure.Interfaces;
|
|
|
|
namespace SQLLinter;
|
|
|
|
public class Diagramer
|
|
{
|
|
private ISqlDiagramProcessor _diagramProcessor;
|
|
|
|
public Diagramer(BpmnDiagram bpmnDiagram
|
|
, IFragmentBuilder fragmentBuilder
|
|
, ISqlStreamReaderBuilder sqlStreamReaderBuilder
|
|
)
|
|
{
|
|
_diagramProcessor = new SqlDiagramProcessor(fragmentBuilder, bpmnDiagram, sqlStreamReaderBuilder);
|
|
}
|
|
|
|
public void Run(string filePath)
|
|
{
|
|
this.Run([filePath]);
|
|
}
|
|
|
|
public void Run(List<string> filePaths)
|
|
{
|
|
List<string> files = FileHelpers.FindFilesWithMask(filePaths);
|
|
|
|
_diagramProcessor.ProcessList(filePaths);
|
|
}
|
|
|
|
public void Run(string fileName, Stream fileReader)
|
|
{
|
|
Run(new Dictionary<string, Stream> { [fileName] = fileReader });
|
|
}
|
|
|
|
public void Run(Dictionary<string, Stream> files)
|
|
{
|
|
_diagramProcessor.ProcessList(files);
|
|
}
|
|
}
|