Import from internal git

This commit is contained in:
2025-10-11 13:08:09 +02:00
commit 97aaa715dc
175 changed files with 7014 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
using Core.Exceptions;
using Core.Templates;
using Mustache;
namespace Generator.Infrastructure.TemplateFiller;
public class MustacheFiller : AbstractFiller
{
public MustacheFiller(ITemplate template)
{
Template = template;
}
/// <inheritdoc/>
public override void Fill()
{
var compiler = new FormatCompiler
{
RemoveNewLines = false
};
var generator = compiler.Compile(Template?.GetText());
Render = generator.Render(Template?.GetData());
}
/// <inheritdoc/>
public override void Write(string outputPath)
{
if (Render == null) throw new FillerException(
"Filler Exception : No text can be written. Have you forgot to call the Fill method ?");
using StreamWriter file = new StreamWriter(outputPath);
file.Write(Render);
}
}