Diff : Algorithm.Diff Namespace
Hunk

A hunk is a range in the original list that is in correspondence with ranges in one or more other lists.

public abstract class Hunk


Remarks
Hunks represent same or change portions of a list.
Members

See Also: Inherited members from object.

Properties
ChangedLists [read-only]
abstract
int . Gets the number of lists in this hunk representing changes to the original document.
Conflict [read-only]
abstract
bool . Gets whether this hunk represents a merge conflict.
Same [read-only]
abstract
bool . Gets whether this hunk represents a portion of the original document in which no changes were made.
Methods
abstract Changes (int) : Range
Gets the range in a revision document represented by this hunk.
abstract IsSame (int) : bool
Gets whether any changes were made in one of the revised documents in this hunk.
MaxLines () : int
Gets the maximum of the number of elements contained in the ranges for the original document and the revision documents.
abstract Original () : Range
Gets the range in the original document represented by this hunk.
Member Details
IsSame
public abstract bool IsSame (int index)

Gets whether any changes were made in one of the revised documents in this hunk.

Parameters
index
A 0-based index indicating which revision document to return a portion of.
Returns
Whether the revised document had any changes in this hunk.
Remarks
For diffs created by hunks, index must be zero.

Original
public abstract Range Original ()

Gets the range in the original document represented by this hunk.

Returns
The range in the original document in correspondence with the ranges in the changed documents, returned by Algorithm.Diff.Hunk.Changes(int).
Remarks
None.

Changes
public abstract Range Changes (int index)

Gets the range in a revision document represented by this hunk.

Parameters
index
A 0-based index indicating which revision document to return a portion of.
Returns
A Range representing the portion of the revision document represented by this hunk.
Remarks
For diffs created by hunks, index must be zero.

MaxLines
public int MaxLines ()

Gets the maximum of the number of elements contained in the ranges for the original document and the revision documents.

Returns
The maximum value of the return of Algorithm.Diff.Range.Count() returned for Algorithm.Diff.Hunk.Original() and Algorithm.Diff.Hunk.Changes(int) for each revised document.
Remarks
To be added.

ChangedLists
public abstract int ChangedLists { get; }

Gets the number of lists in this hunk representing changes to the original document.

Value
For hunks created by diffs, this property always returns 1. For hunks created by merges, this property returns the number of revision documents.
Remarks
None.

Same
public abstract bool Same { get; }

Gets whether this hunk represents a portion of the original document in which no changes were made.

Value
true if all of the revision documents match the original document, false otherwise.
Remarks
None.

Conflict
public abstract bool Conflict { get; }

Gets whether this hunk represents a merge conflict.

Value
true if more than one revision list had changes over the original document, false otherwise.
Remarks
As diff hunks only have one revision document, this property always returns false for hunks created by diffs.