public TextLinesCursor(TextLinesCursor InCsr) { mLines = InCsr.mLines; mLinesNode = InCsr.mLinesNode; mLineOx = InCsr.mLineOx; mRltv = InCsr.mRltv; }
public TextLinesCursor() { mLines = null; mLinesNode = null; mLineOx = -1; mRltv = RelativePosition.None; }
public void LineAdvance(TextLines InLines) { switch (mRltv) { case RelativePosition.Begin: mLinesNode = InLines.FirstLine; break; case RelativePosition.Before: break; case RelativePosition.At: mLinesNode = mLinesNode.Next; break; case RelativePosition.After: mLinesNode = mLinesNode.Next; break; default: mLinesNode = null; break; } if (mLinesNode == null) { mRltv = RelativePosition.None; } else { mRltv = RelativePosition.At; mLineOx = 0; } }
public TextLinesCursor( LinkedListNode <TextLine> InLinesNode, int InLineOx, RelativePosition InRltv) { mLines = null; mLinesNode = InLinesNode; mLineOx = InLineOx; mRltv = InRltv; }
public TextLinesCursor( TextLines InLines, RelativePosition InRltv) { mLines = InLines; mLinesNode = null; mLineOx = -1; mRltv = InRltv; if ((InRltv != RelativePosition.Begin) && (InRltv != RelativePosition.End) && (InRltv != RelativePosition.None)) { throw new ApplicationException( "only pos bgn and pos end allowed thru this constructor"); } }
private static TextLinesCursor Scanner_InitialCursorSetup( TextLines InLines, TextLinesCursor InCsr) { TextLinesCursor csr = new TextLinesCursor(InCsr); if (csr.Position == RelativePosition.Begin) { csr.LineAdvance(InLines); } else if (csr.EndOfLine == true) { csr.LineAdvance(InLines); } return(csr); }
public static TextLines FileToTextLines(string InPath) { TextLines lines = new TextLines(); StringBuilder sb = new StringBuilder(20000); using (StreamReader sr = new StreamReader(InPath)) { while (true) { string line = sr.ReadLine(); if (line == null) { break; } lines.AddLast(line); } } return(lines); }