//出力ソース名を取得 public string GetInitalSource(out string filename) { string mark = ":output="; filename = string.Empty; var output = string.Empty; foreach (var i in EditUtil.Split(m_template_source)) { if (string.IsNullOrEmpty(i) || string.IsNullOrEmpty(i.TrimEnd())) { continue; } var l = i.TrimEnd(); if (l.StartsWith(mark)) { filename = l.Substring(mark.Length); continue; } if (l[0] == ':') { continue; } output += l + "\n"; } return(output); }
//ファンクション用ファイル取得 public string GetInitialFuncSource(string tempfunc = null) { if (string.IsNullOrEmpty(tempfunc)) { tempfunc = m_template_statefunc; } var output = string.Empty; foreach (var i in EditUtil.Split(tempfunc)) { if (string.IsNullOrEmpty(i) || string.IsNullOrEmpty(i.TrimEnd())) { continue; } var l = i.TrimEnd(); if (l[0] == ':') { continue; } output += l + "\n"; } return(output); }
//プログラムランゲージ指定を取得 public string GetInitalSource(out string filename, out string lang, out string enc, out string tempfunc) { string mark_output = ":output="; string mark_lang = ":lang="; string mark_enc = ":enc="; string mark_tempfunc = ":templatefunc="; filename = string.Empty; lang = string.Empty; enc = string.Empty; tempfunc = string.Empty; var output = string.Empty; foreach (var i in EditUtil.Split(m_template_source)) { if (string.IsNullOrEmpty(i) || string.IsNullOrEmpty(i.TrimEnd())) { continue; } var l = i.TrimEnd(); if (l.StartsWith(mark_output)) { filename = l.Substring(mark_output.Length); continue; } if (l.StartsWith(mark_lang)) { lang = l.Substring(mark_lang.Length); } if (l.StartsWith(mark_enc)) { enc = l.Substring(mark_enc.Length); } if (l.StartsWith(mark_tempfunc)) { tempfunc = l.Substring(mark_tempfunc.Length); } if (l[0] == ':') { continue; } output += l + "\n"; } return(output); }