StringView class Null safety

A wrapper class to facilitate operations on a String.

A pointer is used to indicate the index at which this view is currently operating at. All operations on this view leave an entry in its history, and can be undone using undo.


StringView(String buffer)
Construct a new StringView on buffer.


buffer String
The String this view represents.
current String
The character at the current index in buffer.
end int
The size of this views buffer length.
eof bool
Whether this view is at EOF, i.e if the current pointer has reached the end of the buffer.
hashCode int
The hash code for this object. [...]
read-only, inherited
history List<int>
A list of indices this view was at before operations, ordered from least recent first to most recent last.
read / write
index int
The current index of this views pointer.
read / write
isWhitespace bool
Whether the current character is whitespace. [...]
remaining String
The remaining data in buffer after the current index.
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


copy() StringView
Create a copy of this StringView with a matching buffer, index and history.
escape(int start, int end) String
Escape characters in buffer from start to end.
getQuotedWord() String
Get the next quoted word after the pointer. [...]
getWord() String
Get the next word after the pointer. [...]
isEscaped(int index) bool
Returns true if the character at index is escaped and false otherwise.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
skipString(String s) bool
Check if the data after the pointer matches s, and move the pointer beyond it if it does. Retuns true if the string matches s and false otherwise.
skipWhitespace() → void
Moves the pointer past any whitespace until the next non-whitespace character or EOF is found.
toString() String
A string representation of this object. [...]
undo() → void
Undo the last operation on this view. [...]


operator ==(Object other) bool
The equality operator. [...]