public TemplateReplacer(Src src, string pattern, SubstituteFunction subst, int chunk_size = 4096) { Src = new SrcStack(src); Substitute = subst; Pattern = new Regex(pattern); ChunkSize = chunk_size; OutputLocation = new Loc(); m_match_ofs = 0; }
/// <summary>Process a string template</summary> public static string Process(Src template, string pattern, SubstituteFunction subst, int chunk_size = 4096) { using var tr = new TemplateReplacer(template, pattern, subst, chunk_size); return(tr.ReadToEnd()); }