|
Class: Diff2
Object
|
+--Diff2
|
+--Diff2::HuntMcilroy
|
+--Diff2::MyersUkkonen
- Package:
- stx:libtool
- Category:
- Collections-Sequenceable-Diff
- Version:
- rev:
1.8
date: 2022/12/06 14:16:50
- user: cg
- file: Diff2.st directory: libtool
- module: stx stc-classLibrary: libtool
Generic diff/comm utilities.
Agnostic as to the longestCommonSubsequence algorithm used.
Instance Variables
file1: <SequenceableCollection> One of the two files to compare.
file2: <SequenceableCollection> The other of the files to compare.
[instance variables:]
[class variables:]
copyrightCopyright (c) 2007-2012 Tony Garnock-Jones
This code is based on Squeak's DiffMerge package
written by Tony Garnock-Jones. Original project's web site:
http://www.squeaksource.com/DiffMerge
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the 'Software'), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
accessing
-
HuntMcilroy
-
-
MyersUkkonen
-
instance creation
-
new
-
I'm abstract, so instantiate some default here
accessing
-
file1
-
-
file1: anObject
-
-
file2
-
-
file2: anObject
-
diffing
-
comm
-
Returns a collection of similarities and differences between the two files. Each entry in the resulting collection is either (#common -> {...}) or (#different -> ({...} -> {...})).
-
diff
-
Returns a DiffPatch instance that can be used in future to transform file1 into file2.
-
diffIndices
-
Returns a collection of (DiffChunk -> DiffChunk) associations mapping differing regions of file1 and file2 onto each other.
-
longestCommonSubsequence
-
The longestCommonSubsequence (LCS) algorithm is at the heart of a diff/comm algorithm.
** This method must be redefined in concrete classes (subclassResponsibility) **
private
-
addCommonBlock: aSubCollection ifNonEmptyTo: aCollection
-
-
emptyCaches
-
Subclasses should implement this to clear any cached state they may have built up.
-
maybeAddCommonBlock: common to: result p1: p1 p2: p2 limit1: limit1 limit2: limit2
-
For internal use by comm.
-
maybeAddDiffChunkTo: result p1: p1 p2: p2 limit1: limit1 limit2: limit2
-
For internal use by diffIndices.
Chunk
HuntMcilroy
MyersUkkonen
Patch
|