Loading...
Searching...
No Matches
TextDiff::Change Struct Reference

Describes a change, which can be either an insertion or deletion. More...

Public Member Functions

bool isDeletion () const noexcept
 Returns true if this change is a deletion, or false for an insertion.
 
String appliedTo (const String &original) const noexcept
 Returns the result of applying this change to a string.
 

Public Attributes

String insertedText
 If this change is a deletion, this string will be empty; otherwise, it'll be the text that should be inserted at the index specified by start.
 
int start
 Specifies the character index in a string at which text should be inserted or deleted.
 
int length
 If this change is a deletion, this specifies the number of characters to delete.
 

Detailed Description

Describes a change, which can be either an insertion or deletion.

Member Function Documentation

◆ isDeletion()

bool TextDiff::Change::isDeletion ( ) const
noexcept

Returns true if this change is a deletion, or false for an insertion.

◆ appliedTo()

String TextDiff::Change::appliedTo ( const String & original) const
noexcept

Returns the result of applying this change to a string.

Member Data Documentation

◆ insertedText

String TextDiff::Change::insertedText

If this change is a deletion, this string will be empty; otherwise, it'll be the text that should be inserted at the index specified by start.

◆ start

int TextDiff::Change::start

Specifies the character index in a string at which text should be inserted or deleted.

◆ length

int TextDiff::Change::length

If this change is a deletion, this specifies the number of characters to delete.

For an insertion, this is the length of the new text being inserted.

linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram