Skip to content

StringPointer

Defined in: packages/core/src/string/string-pointer.ts:10

A C-like string pointer.

It maintains an offset into a string and provides methods to get the substring from the current offset, check if the offset is out of range, and get the length of the remaining string.

new StringPointer(source): StringPointer

Defined in: packages/core/src/string/string-pointer.ts:19

Creates a new StringPointer instance.

string

The source string.

StringPointer

readonly source: string

Defined in: packages/core/src/string/string-pointer.ts:19

The source string.

get length(): number

Defined in: packages/core/src/string/string-pointer.ts:44

The length of the remaining string from the current offset.

number


get offset(): number

Defined in: packages/core/src/string/string-pointer.ts:22

The current offset.

number

set offset(offset): void

Defined in: packages/core/src/string/string-pointer.ts:27

Sets the current offset.

number

void


get value(): string

Defined in: packages/core/src/string/string-pointer.ts:49

The substring from the current offset to the end of the string.

string

isOutOfRange(): boolean

Defined in: packages/core/src/string/string-pointer.ts:39

Checks if the current offset is out of range of the source string.

boolean

true if the offset is out of range, false otherwise.