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.
IsAtStart
Indicates whether the current Offset is at the start of the text buffer.
Length
The number of characters in the text buffer.
Offset
The current reader offset in the text buffer.
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
Peek()
Peeks at the character at the current Offset without advancing.
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.
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.