Skip to content
ConsoleMonster
Class

TextDiffResult

ConsoleMonster.Changes

Namespace
ConsoleMonster.Changes
Assembly
ConsoleMonster
Modifiers
sealed

An immutable line comparison that can be rendered repeatedly or exported as a unified diff.

Inheritance

  • object
  • TextDiffResult

Usage

Explore 3 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by 2

Accepted by parameters 1

Methods

public string ToUnifiedText() #

Produces plain unified diff text with LF separators, source labels, hunk ranges and missing-final-newline markers. Identical inputs produce an empty string. No terminal markup or escape sequences are added.

Returns

string The unified diff, ending in LF when nonempty.

Properties

public IReadOnlyList<TextDiffLine> Lines { get; } #

All lines, including unchanged regions, in edit order.

public int Context { get; } #

The unchanged context retained around each change.

public string ReferenceLabel { get; } #

The original-text label, with control characters replaced by spaces.

public string DifferenceLabel { get; } #

The new-text label, with control characters replaced by spaces.

public int Added { get; } #

The number of added lines.

public int Removed { get; } #

The number of removed lines.

public bool HasChanges { get; } #

Whether any content or final-newline changes were found.