LineReader Struct
A line reader from a TextReader that can provide precise source position
public struct LineReaderConstructors
| Name | Description |
|---|---|
| LineReader(string) | Initializes a new instance of the LineReader class. |
LineReader(string)
LineReader.csInitializes a new instance of the LineReader class.
public LineReader(string text)Parameters
textstring
Exceptions
ArgumentNullExceptionArgumentOutOfRangeException- bufferSize cannot be <= 0
Properties
| Name | Description |
|---|---|
| SourcePosition | Gets the char position of the line. Valid for the next line before calling LineReader.ReadLine. |
SourcePosition
LineReader.csGets the char position of the line. Valid for the next line before calling LineReader.ReadLine.
public readonly int SourcePosition { get; }Property value
Methods
| Name | Description |
|---|---|
| ReadLine() | Reads a new line from the underlying TextReader and update the LineReader.SourcePosition for the next line. |
ReadLine()
LineReader.csReads a new line from the underlying TextReader and update the LineReader.SourcePosition for the next line.
public StringSlice ReadLine()Returns
StringSlice A new line or null if the end of TextReader has been reached