Setup Git Repository Parsing

This commit is contained in:
Simon Martens
2023-09-10 01:09:20 +02:00
parent 4e3c65dc6f
commit 8fd0050cf3
69 changed files with 1228 additions and 1461 deletions

View File

@@ -4,6 +4,7 @@ using HaDocument.Logic;
using HaDocument.Reactors;
using HaXMLReader.Interfaces;
using HaXMLReader;
using System.Xml.Linq;
namespace HaDocument
{
@@ -32,6 +33,18 @@ namespace HaDocument
return GetLibrary();
}
public static ILibrary Create(IHaDocumentOptions Settings, XElement root) {
_lib = new IntermediateLibrary();
SettingsValidator.Validate(Settings);
_settings = Settings;
_createReader(root);
_createReactors();
_reader.Read();
_library = _createLibrary();
_reader.Dispose();
return GetLibrary();
}
private static void _createReactors() {
new EditreasonReactor(_reader, _lib, _settings.NormalizeWhitespace);
new HandDefsReactor(_reader, _lib);
@@ -49,6 +62,10 @@ namespace HaDocument
_reader = new FileReader(_settings.HamannXMLFilePath);
}
private static void _createReader(XElement root) {
_reader = new XElementReader(root);
}
private static ILibrary _createLibrary()
=> _lib.GetLibrary(_settings);