ITextBufferReader Interface
Provides a full-featured reader for scanning a basic text buffer, with optional support for header and footer regions that wrap the main content region.
public interface ITextBufferReader : ISimpleTextBufferReader
Remarks
The reader can push its current state onto a state stack with PushState() and later use PopState() to restore that state, which is useful for speculative lookahead when parsing.
Properties
HasStates
Indicates whether there are any saved states on the reader's state stack.
IsWhitespaceOnlyAfterOnLine
Indicates whether only whitespace characters appear at and after the Offset on the current line.
bool IsWhitespaceOnlyAfterOnLine { get; }
Property Value
See Also
IsWhitespaceOnlyBeforeOnLine
Indicates whether only whitespace characters appear before the Offset on the current line.
bool IsWhitespaceOnlyBeforeOnLine { get; }
Property Value
See Also
OffsetDelta
The amount by which to alter the offset values that are parsed.
Position
The current reader TextPosition in the text buffer.
TextPosition Position { get; }
Property Value
See Also
PositionDelta
The amount by which to alter the Position values that are parsed.
TextPosition PositionDelta { get; }
Property Value
Remarks
The Character portion only affects character offset of the line after the Line count.
See Also
Methods
AsTextReader()
Returns a TextReader wrapper for this reader.
TextReader AsTextReader()
Returns
See Also
Peek(int)
Peeks at a certain character from the text buffer after the current Offset without seeking past it.
char Peek(int count)
| Parameter | Type | Description |
|---|---|---|
| count | int | The number of characters away from the current Offset at which to peek. |
Returns
- char:
The character that was read.
See Also
PopState()
Pops the top state from the stack and restores the reader to that state.
PushState()
Pushes the current reader state onto the stack for later restoration.
ReadReverseThrough(char)
Reverse reads characters from the text buffer until the specified character is read through.
bool ReadReverseThrough(char ch)
| Parameter | Type | Description |
|---|---|---|
| ch | char | The desired character. |
Returns
- bool:
trueif the desired character was read; otherwise,falseif the start of the text buffer was reached.
See Also
ReadReverseThrough(char, int)
Reverse reads characters from the text buffer until the specified character is read through, or the specified offset is reached.
bool ReadReverseThrough(char ch, int minOffset)
| Parameter | Type | Description |
|---|---|---|
| ch | char | The desired character. |
| minOffset | int | The minimum offset to check. |
Returns
- bool:
trueif the desired character was read; otherwise,falseif the specified offset was reached.
See Also
ReadThrough(char)
Reads characters from the text buffer until the specified character is read through.
bool ReadThrough(char ch)
| Parameter | Type | Description |
|---|---|---|
| ch | char | The desired character. |
Returns
- bool:
trueif the desired character was read; otherwise,falseif the end of the text buffer was reached.
See Also
ReadThrough(char, int)
Reads characters from the text buffer until the specified character is read through, or the specified offset is reached.
bool ReadThrough(char ch, int maxOffset)
| Parameter | Type | Description |
|---|---|---|
| ch | char | The desired character. |
| maxOffset | int | The maximum offset to check. |
Returns
- bool:
trueif the desired character was read; otherwise,falseif the specified offset was reached.
See Also
Inherited Members
- ISimpleTextBufferReader.GetSubstring(int, int)
- ISimpleTextBufferReader.Peek()
- ISimpleTextBufferReader.PeekReverse()
- ISimpleTextBufferReader.Read()
- ISimpleTextBufferReader.ReadReverse()
- ISimpleTextBufferReader.IsAtEnd
- ISimpleTextBufferReader.IsAtStart
- ISimpleTextBufferReader.Length
- ISimpleTextBufferReader.Offset
Extension Methods
- ObjectExtensions.TryConvertToDouble(object, out double)
- ObjectExtensions.TryConvertToDouble(object, IFormatProvider, out double)