TextDiffEntry Struct

public readonly struct TextDiffEntry : IEquatable<TextDiffEntry>

No documentation is available.

Implements

Constructors

NameDescription
TextDiffEntry(TextDiffOperation, string)
TextDiffEntry(TextDiffOperation, string?, string?)

TextDiffEntry overloads

TextDiffEntry(TextDiffOperation, string)

TextDiffEntry.cs
public TextDiffEntry(TextDiffOperation operation, string text)
Parameters
operation TextDiffOperation
text string

No documentation is available.

TextDiffEntry(TextDiffOperation, string?, string?)

TextDiffEntry.cs
public TextDiffEntry(TextDiffOperation operation, string? oldText, string? newText)
Parameters
operation TextDiffOperation
oldText string?
newText string?

No documentation is available.

Properties

NameDescription
NewTextGets the chunk as it appears in the new text, or null when TextDiffEntry.Operation is TextDiffOperation.Delete.
OldTextGets the chunk as it appears in the old text, or null when TextDiffEntry.Operation is TextDiffOperation.Insert.
Operation
TextGets TextDiffEntry.OldText, or TextDiffEntry.NewText when TextDiffEntry.Operation is TextDiffOperation.Insert.

Gets the chunk as it appears in the new text, or null when TextDiffEntry.Operation is TextDiffOperation.Delete.

public string? NewText { get; }

Property value

string?

Remarks

When an option such as TextDiffOptions.IgnoreCase or TextDiffOptions.IgnoreWhitespace makes two different chunks compare equal, an TextDiffOperation.Equal entry keeps both sides: TextDiffEntry.OldText and TextDiffEntry.NewText then differ. Append TextDiffEntry.NewText for TextDiffOperation.Equal and TextDiffOperation.Insert entries to rebuild the new text.

Gets the chunk as it appears in the old text, or null when TextDiffEntry.Operation is TextDiffOperation.Insert.

public string? OldText { get; }

Property value

string?

public TextDiffOperation Operation { get; }

Property value

TextDiffOperation

No documentation is available.

public string Text { get; }

Property value

string

Remarks

For an TextDiffOperation.Equal entry this is the chunk from the old text, which is not necessarily the chunk from the new text. Use TextDiffEntry.OldText and TextDiffEntry.NewText to rebuild either side of the diff.

Methods

NameDescription
Equals(TextDiffEntry)
Equals(object?)
GetHashCode()
ToString()

Equals overloads

Equals(TextDiffEntry)

TextDiffEntry.cs
public bool Equals(TextDiffEntry other)
Parameters
other TextDiffEntry
Returns

bool

No documentation is available.

Equals(object?)

TextDiffEntry.cs
public override bool Equals(object? obj)
Parameters
obj object?
Returns

bool

No documentation is available.

GetHashCode()

TextDiffEntry.cs
public override int GetHashCode()

Returns

int

No documentation is available.

public override string ToString()

Returns

string

No documentation is available.

Operators

NameDescription
operator ==(TextDiffEntry, TextDiffEntry)
operator !=(TextDiffEntry, TextDiffEntry)

operator ==(TextDiffEntry, TextDiffEntry)

TextDiffEntry.cs
public static bool operator ==(TextDiffEntry left, TextDiffEntry right)

Parameters

left TextDiffEntry
right TextDiffEntry

Returns

bool

No documentation is available.

operator !=(TextDiffEntry, TextDiffEntry)

TextDiffEntry.cs
public static bool operator !=(TextDiffEntry left, TextDiffEntry right)

Parameters

left TextDiffEntry
right TextDiffEntry

Returns

bool

No documentation is available.