2025-03-19 23:18:26 +03:00
|
|
|
namespace mROA.CodegenTools
|
|
|
|
|
{
|
2025-03-23 19:32:41 +03:00
|
|
|
public class LiteralTemplateSection : ITemplateSection, IBaking
|
2025-03-19 23:18:26 +03:00
|
|
|
{
|
|
|
|
|
private string _internalText;
|
2025-03-19 23:21:00 +03:00
|
|
|
|
2025-03-20 16:36:32 +03:00
|
|
|
public LiteralTemplateSection(string internalText, TemplateDocument context)
|
2025-03-19 23:21:00 +03:00
|
|
|
{
|
|
|
|
|
_internalText = internalText;
|
|
|
|
|
Context = context;
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-19 23:18:26 +03:00
|
|
|
public TemplateDocument Context { get; set; }
|
2025-03-23 19:32:41 +03:00
|
|
|
public int TargetLength => _internalText.Length;
|
2025-03-19 23:42:25 +03:00
|
|
|
|
2025-03-19 23:18:26 +03:00
|
|
|
public string Bake()
|
|
|
|
|
{
|
2025-03-23 19:32:41 +03:00
|
|
|
return ToString();
|
2025-03-19 23:18:26 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
return _internalText;
|
|
|
|
|
}
|
2025-03-25 20:00:08 +03:00
|
|
|
|
|
|
|
|
public object Clone()
|
|
|
|
|
{
|
|
|
|
|
return new LiteralTemplateSection(_internalText, Context);
|
|
|
|
|
}
|
2025-03-19 23:18:26 +03:00
|
|
|
}
|
|
|
|
|
}
|