eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'Diff2':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: Diff2


Inheritance:

   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

Description:


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:]

copyright

Copyright (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.

Class protocol:

accessing
o  HuntMcilroy

o  MyersUkkonen

instance creation
o  new
I'm abstract, so instantiate some default here


Instance protocol:

accessing
o  file1

o  file1: anObject

o  file2

o  file2: anObject

diffing
o  comm
Returns a collection of similarities and differences between the two files. Each entry in the resulting collection is either (#common -> {...}) or (#different -> ({...} -> {...})).

o  diff
Returns a DiffPatch instance that can be used in future to transform file1 into file2.

o  diffIndices
Returns a collection of (DiffChunk -> DiffChunk) associations mapping differing regions of file1 and file2 onto each other.

o  longestCommonSubsequence
The longestCommonSubsequence (LCS) algorithm is at the heart of a diff/comm algorithm.

** This method must be redefined in concrete classes (subclassResponsibility) **

private
o  addCommonBlock: aSubCollection ifNonEmptyTo: aCollection

o  emptyCaches
Subclasses should implement this to clear any cached state they may have built up.

o  maybeAddCommonBlock: common to: result p1: p1 p2: p2 limit1: limit1 limit2: limit2
For internal use by comm.

o  maybeAddDiffChunkTo: result p1: p1 p2: p2 limit1: limit1 limit2: limit2
For internal use by diffIndices.


Private classes:

    Chunk
    HuntMcilroy
    MyersUkkonen
    Patch


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 27 Jul 2024 02:29:59 GMT