In This Article

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.

bool HasStates { get; }

Property Value

bool

See Also

IsWhitespaceOnlyAfterOnLine

Indicates whether only whitespace characters appear at and after the Offset on the current line.

bool IsWhitespaceOnlyAfterOnLine { get; }

Property Value

bool

See Also

IsWhitespaceOnlyBeforeOnLine

Indicates whether only whitespace characters appear before the Offset on the current line.

bool IsWhitespaceOnlyBeforeOnLine { get; }

Property Value

bool

See Also

OffsetDelta

The amount by which to alter the offset values that are parsed.

int OffsetDelta { get; }

Property Value

int

See Also

Position

The current reader TextPosition in the text buffer.

TextPosition Position { get; }

Property Value

TextPosition

See Also

PositionDelta

The amount by which to alter the Position values that are parsed.

TextPosition PositionDelta { get; }

Property Value

TextPosition

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

TextReader

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.

bool PopState()

Returns

bool:

true if a pop occurred; otherwise, false.

See Also

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:

true if the desired character was read; otherwise, false if 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:

true if the desired character was read; otherwise, false if 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:

true if the desired character was read; otherwise, false if 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:

true if the desired character was read; otherwise, false if the specified offset was reached.

See Also

Inherited Members

Extension Methods

See Also