Skip to content

Interface IImmutableStringReader

Namespace: Void.Minecraft.Commands.Brigadier
Assembly: Void.Minecraft.dll

Exposes command input and a movable parsing cursor.

public interface IImmutableStringReader

Properties

CanRead

Gets whether at least one character can be read.

bool CanRead { get; }

Property Value

bool

Cursor

Gets or sets the zero-based cursor.

int Cursor { get; set; }

Property Value

int

Peek

Gets the character at the current cursor without advancing it.

char Peek { get; }

Property Value

char

Read

Gets the source prefix before the cursor.

string Read { get; }

Property Value

string

Remaining

Gets the source suffix beginning at the cursor.

string Remaining { get; }

Property Value

string

RemainingLength

Gets the number of characters from the cursor through the end.

int RemainingLength { get; }

Property Value

int

Source

Gets the complete source string.

string Source { get; init; }

Property Value

string

TotalLength

Gets the total source length.

int TotalLength { get; }

Property Value

int

Methods

CanReadLength(int)

Determines whether advancing the cursor by length characters remains within the source.

bool CanReadLength(int length)

Parameters

length int

The number of characters to test from the current cursor position.

Returns

bool

true when length characters can be read without moving past ; otherwise, false.

PeekAt(int)

Gets a character at an offset from the cursor without advancing it.

char PeekAt(int offset)

Parameters

offset int

The relative character offset.

Returns

char

The selected character.