public void LevelTagAndRemain(char [] line, LineUtil.LineData ctx) { Split(line, ' '); ctx.Level = line[_starts[0]]; ctx.Tag = Tag(line); ctx.Remain1 = Remain(line) ?? new char[0]; }
// Handle a sub-tag with possible CONC / CONT sub-sub-tags. public static string extendedText(ParseContextCommon ctx) { LineUtil.LineData eTextLd = new LineUtil.LineData(); StringBuilder txt = new StringBuilder(ctx.Remain.TrimStart(), 1024); int i = ctx.Begline + 1; int max = ctx.Lines.Max; for (; i < max; i++) { ctx.gs.LevelTagAndRemain(ctx.Lines.GetLine(i), eTextLd); if (eTextLd.Level <= ctx.Level) { break; // end of sub-record } if (eTextLd.Tag == "CONC") { txt.Append(eTextLd.Remain); // must keep trailing space } else if (eTextLd.Tag == "CONT") { txt.Append("\n"); // NOTE: not appendline, which is \r\n txt.Append(eTextLd.Remain); // must keep trailing space } else { break; // non-CONC, non-CONT: stop! } } ctx.Endline = i - 1; return(txt.ToString()); }