DiffLib
This class holds a single collection from either the first or the second, or both,
collections given to the class, along
with the type of change that the elements produce.
Initializes a new instance of .
The type of change this details.
The element from the first collection. If is , then
this parameter has no meaning.
The element from the second collection. If is , then
this parameter has no meaning.
Indicates whether the current object is equal to another object of the same type.
true if the current object is equal to the parameter; otherwise, false.
An object to compare with this object.
Determines whether the specified is equal to the current .
true if the specified is equal to the current ; otherwise, false.
The to compare with the current . 2
Serves as a hash function for a particular type.
A hash code for the current .
2
Returns a that represents the current .
A that represents the current .
2
The type of change this details.
The element from the first collection. If is , then
the value of this property has no meaning.
The element from the second collection. If is , then
the value of this property has no meaning.
This enum is used by to specify how
the two elements from the two collections relate.
The two elements are the same.
The second element was added in the second collection.
The first element was removed from the second collection.
The first element was changed/replaced with the second element in the second collection.
This class implements the basic diff algorithm by recursively applying the Longest Common Substring
on pieces of the collections, and reporting sections that are similar, and those that are not,
in the appropriate sequence.
The types of elements in the collections being compared.
Initializes a new instance of
using the default instance for the
type.
The first collection of items.
The second collection of items.
is null.
- or -
is null.
Initializes a new instance of .
The first collection of items.
The second collection of items.
The that will be used to compare elements from
with elements from .
is null.
- or -
is null.
- or -
is null.
Returns an enumerator that iterates through the collection.
A that can be used to iterate through the collection.
1
Generates the diff between the two collections.
This class contains a single section of diff output from the
method.
Initializes a new instance of .
If true, then the section specifies a section from the first
collection that is equal to a section from the second collection;
otherwise, if false, then the section from the first
collection was replaced with the section from the second collection.
The length of the section in the first collection. Can be 0 if
the section specifies that new content was added in the second
collection.
The length of the section in the second collection. Can be 0 if
the section specifies that old content was deleted in the second
collection.
is negative.
- or -
is negative.
is true but is not equal to .
Indicates whether the current object is equal to another object of the same type.
true if the current object is equal to the parameter; otherwise, false.
An object to compare with this object.
Determines whether the specified is equal to the current .
true if the specified is equal to the current ; otherwise, false.
The to compare with the current . 2
Serves as a hash function for a particular type.
A hash code for the current .
2
Returns a that represents the current .
A that represents the current .
2
Gets whether the specifies equal sections in the two
collections, or differing sections.
If true, then the section specifies a section from the first
collection that is equal to a section from the second collection;
otherwise, if false, then the section from the first
collection was replaced with the section from the second collection.
The length of the section in the first collection.
The length of the section in the second collection.
This interface must be implemented by classes that will do similarity-filtering
during alignment () to determine
if two aligned elements are similar enough to report
them as a change, instead of as a delete plus an add.
The type of elements being compared.
Determines if the two values are similar enough to align them
as a change, instead of not aligning them but reporting them
as a delete plus an add instead.
The first value to compare against .
The second value to compare against .
true if the two values are similar enough to report
them as a change; false if the two values aren't similar enough
but needs to be reported as a delete plus an add.
This interface must be implemented by classes that will do similarity-calculation
for use with the class.
The type of elements being compared.
Does a similarity comparison between the two values and returns their
similarity, a value ranging from 0.0 to 1.0, where 0.0 means they're
completely different and 1.0 means they have the same value.
The first value to compare.
The second value to compare.
A value ranging from 0.0 to 1.0, where 0.0 means they're
completely different and 1.0 means they have the same value.
This class implements the LCS algorithm, to find the longest common substring that exists
in two collections, and return the locations of those substrings.
The types of elements in the collections being compared.
Initializes a new instance of the class
using the default instance for the
type.
The first collection of items.
The second collection of items.
is null.
- or -
is null.
Initializes a new instance of the class.
The first collection of items.
The second collection of items.
The that will be used to compare elements from
with elements from .
is null.
- or -
is null.
- or -
is null.
Finds the longest common substring and returns its position in the two collections, and
its length, or null if no such common substring can be located.
A containing the positions of the two substrings, one position
for each collection, both 0-based, and the length of the substring. If no common substring can be found, null
will be returned.
Finds the longest common substring and returns its position in the two collections, and
its length, or null if no such common substring can be located.
The starting position in the first collection, 0-based. Included in the search.
The ending position in the first collection, 0-based. Not included in the search.
The starting position in the second collection, 0-based. Included in the search.
The ending position in the second collection, 0-based. Not included in the search.
A containing the positions of the two substrings, one position
for each collection, both 0-based, and the length of the substring. If no common substring can be found, null
will be returned.
is less than 0.
- or -
is greater than .
- or -
is greater than the length of the first collection.
- or -
is less than 0.
- or -
is greater than .
- or -
is greater than the length of the second collection.
This class holds the result of calling .
Initializes a new instance of .
The position in the first collection, 0-based.
The position in the second collection, 0-based.
The length of the common substring.
is negative.
- or -
is negative.
- or -
is zero or negative.
Indicates whether the current object is equal to another object of the same type.
true if the current object is equal to the parameter; otherwise, false.
An object to compare with this object.
Determines whether the specified is equal to the current .
true if the specified is equal to the current ; otherwise, false.
The to compare with the current . 2
Serves as a hash function for a particular type.
A hash code for the current .
2
Returns a that represents the current .
A that represents the current .
2
The position in the first collection, 0-based.
The position in the second collection, 0-based.
The length of the common substring.
This class implements a slightly more advanced diff algorithm than by
taking the output from and attempting to align individual elements inside
replace-blocks. This is mostly suitable for text file diffs.
The types of elements in the collections being compared.
Initializes a new instance of .
The first collection of items.
The second collection of items.
The that will be used to compare elements from
with elements from .
The that will be used to attempt to align elements
inside blocks that consists of elements from the first collection being replaced
with elements from the second collection.
The that will be used to determine if
two aligned elements are similar enough to be report them as a change from
one to another, or to report them as one being deleted and the other added in
its place.
is null.
- or -
is null.
- or -
is null.
- or -
is null.
Returns an enumerator that iterates through the collection.
A that can be used to iterate through the collection.
1
Generates the diff, one line of output at a time.
A collection of objects, one for
each line in the first or second collection (sometimes one instance for a line
from both, when lines are equal or similar.)
This class implements for strings, doing a very basic "diff" between the two,
and calculating how much of the text occurs in both.
Does a similarity comparison between the two values and returns their
similarity, a value ranging from 0.0 to 1.0, where 0.0 means they're
completely different and 1.0 means they have the same value.
The first value to compare.
The second value to compare.
A value ranging from 0.0 to 1.0, where 0.0 means they're
completely different and 1.0 means they have the same value.
This class implements for strings, doing a very basic "diff" between the two,
and calculating how much of the text occurs in both.
Initializes a new instance of the class.
Initializes a new instance of the class.
The diff predicate used to determine if the strings are
similar enough (see for details.
is null.
Determines if the two values are similar enough to align them
as a change, instead of not aligning them but reporting them
as a delete plus an add instead.
The first value to compare against .
The second value to compare against .
true if the two values are similar enough to report
them as a change; false if the two values aren't similar enough
but needs to be reported as a delete plus an add.
This delegate is used by to
determine if the two strings are similar enough to report them
as a change, instead of as a delete plus and add.
The first string to compare.
The second string to compare.
The diff between and .
true if the strings are similar enough (reported as a change);
otherwise, false (reported as a delete plus an add.)