Table of Contents

Class TextEdit

Namespace
NMF.AnyText
Assembly
NMF.AnyText.Core.dll

Denotes an edit for text

public class TextEdit
Inheritance
TextEdit
Inherited Members

Constructors

TextEdit(ParsePosition, ParsePosition, string[])

Creates a new text edit

public TextEdit(ParsePosition start, ParsePosition end, string[] newText)

Parameters

start ParsePosition

the start of the edit

end ParsePosition

the end of the edit

newText string[]

the new text inserted between start and end

Exceptions

ArgumentException

thrown if start is after end

Properties

End

Gets the end of the edit

public ParsePosition End { get; }

Property Value

ParsePosition

NewText

Gets the new text inserted between start and end

public string[] NewText { get; }

Property Value

string[]

Start

Gets the start of the edit

public ParsePosition Start { get; }

Property Value

ParsePosition

Methods

Apply(string[])

Applies the text edit to the given input

public string[] Apply(string[] input)

Parameters

input string[]

an input array of string lines

Returns

string[]

a text array including the changes

UpdatePosition(ref ParsePosition)

Updates the position after applying this edit. Only Updates the Postion if it is fully after the Edit.

public void UpdatePosition(ref ParsePosition position)

Parameters

position ParsePosition

The position to update.