In This Article

ISimpleTextBufferReader Interface

Provides a lightweight reader for scanning a basic text buffer.

public interface ISimpleTextBufferReader

Properties

IsAtEnd

Indicates whether the current Offset is at the end of the text buffer.

bool IsAtEnd { get; }

Property Value

bool

IsAtStart

Indicates whether the current Offset is at the start of the text buffer.

bool IsAtStart { get; }

Property Value

bool

Length

The number of characters in the text buffer.

int Length { get; }

Property Value

int

Offset

The current reader offset in the text buffer.

int Offset { get; set; }

Property Value

int

Methods

GetSubstring(int, int)

Returns a substring from the text buffer.

string GetSubstring(int offset, int length)
Parameter Type Description
offset int

The offset at which to start the substring.

length int

The number of characters to return.

Returns

string

Peek()

Peeks at the character at the current Offset without advancing.

char Peek()

Returns

char:

The character at the current offset, or '\0' if at the end of the buffer.

PeekReverse()

Peeks at the character before the current Offset without moving it.

char PeekReverse()

Returns

char:

The character before the current offset, or '\0' if at the start of the buffer.

Read()

Reads the character at the current Offset and advances the offset by one.

char Read()

Returns

char:

The character that was read, or '\0' if at the end of the buffer.

ReadReverse()

Reads the character before the current Offset and moves the offset back by one.

char ReadReverse()

Returns

char:

The character that was read, or '\0' if at the start of the buffer.

Extension Methods