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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new StringPointer(
source):StringPointer
Defined in: packages/core/src/string/string-pointer.ts:19
Creates a new StringPointer instance.
Parameters
Section titled “Parameters”source
Section titled “source”string
The source string.
Returns
Section titled “Returns”StringPointer
Properties
Section titled “Properties”source
Section titled “source”
readonlysource:string
Defined in: packages/core/src/string/string-pointer.ts:19
The source string.
Accessors
Section titled “Accessors”length
Section titled “length”Get Signature
Section titled “Get Signature”get length():
number
Defined in: packages/core/src/string/string-pointer.ts:44
The length of the remaining string from the current offset.
Returns
Section titled “Returns”number
offset
Section titled “offset”Get Signature
Section titled “Get Signature”get offset():
number
Defined in: packages/core/src/string/string-pointer.ts:22
The current offset.
Returns
Section titled “Returns”number
Set Signature
Section titled “Set Signature”set offset(
offset):void
Defined in: packages/core/src/string/string-pointer.ts:27
Sets the current offset.
Parameters
Section titled “Parameters”offset
Section titled “offset”number
Returns
Section titled “Returns”void
Get Signature
Section titled “Get Signature”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.
Returns
Section titled “Returns”string
Methods
Section titled “Methods”isOutOfRange()
Section titled “isOutOfRange()”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.
Returns
Section titled “Returns”boolean
true if the offset is out of range, false otherwise.