TextEngine class
Offers services in a text represented as list of lines like insert/delete text or text lines.
- Implementers
Constructors
-
TextEngine(List<
String> lines, BaseLogger logger) - The basic constructor defined by a text given as lines.
- TextEngine.fromString(String text, BaseLogger logger)
- This constructor defines the text given as single string.
Properties
- currentPosition ↔ Position
-
getter/setter pair
- currentRegion ↔ Region
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
-
lines
↔ List<
String> -
getter/setter pair
- logger ↔ BaseLogger
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tempPosition ↔ Position
-
getter/setter pair
Methods
-
asList(
{required Position start, required Position end, bool isInclusive = false, List< String> ? list}) → List<String> -
Returns the text between two positions as a string list.
start
ist the position to start.end
is the the end of the wanted text. ifisInclusive
is trueend
is part of the returned text. -
asString(
{required Position start, required Position end, bool isInclusive = false}) → String -
Returns the text between two positions as a string.
start
ist the position to start.end
is the the end of the wanted text. ifisInclusive
is trueend
is part of the returned text. -
deleteFromTo(
{Position? start, required Position end}) → void -
Deletes the text between the positions
start
andend
. Ifstart
is null the current position is taken. -
deleteLines(
{Position? start, int? countLines}) → void -
goto(
Position position) → void -
Sets the current position to
position
. -
insert(
String text, {Position? position}) → void -
Inserts a string at a given
position
. Ifposition
is null the currentPosition is taken. -
insertLines(
List< String> textLines, {Position? position}) → void -
Inserts a string list at a given
position
. Ifposition
is null the currentPosition is taken. -
lineByIndex(
int ix) → String - Returns a line given by its index. May be a part of the stored line if the currentRegion requires that.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
startColumnByIndex(
int ix) → int - Returns the start column of a line given by its index depending on the currentRegion.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited