Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

Diff Class Reference

Inheritance diagram for Diff:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 Diff ($from_lines, $to_lines)
 reverse ()
 isEmpty ()
 lcs ()
 orig ()
 closing ()
 _check ($from_lines, $to_lines)

Public Attributes

 $edits

Detailed Description

Class representing a 'diff' between two sequences of strings.

Definition at line 668 of file DifferenceEngine.php.


Constructor & Destructor Documentation

Diff::Diff from_lines,
to_lines
 

Constructor. Computes diff between sequences of strings.

Parameters:
$from_lines array An array of strings. (Typically these are lines from a file.)
$to_lines array An array of strings.

Definition at line 680 of file DifferenceEngine.php.


Member Function Documentation

Diff::_check from_lines,
to_lines
 

Check a Diff for validity.

This is here only for debugging purposes.

Definition at line 775 of file DifferenceEngine.php.

References _check(), lcs(), and reverse().

Referenced by _check().

Diff::closing  ) 
 

Get the closing set of lines.

This reconstructs the $to_lines parameter passed to the constructor.

Returns:
array The sequence of strings.

Definition at line 760 of file DifferenceEngine.php.

References $lines.

Diff::isEmpty  ) 
 

Check for empty diff.

Returns:
bool True iff two sequences were identical.

Definition at line 710 of file DifferenceEngine.php.

Diff::lcs  ) 
 

Compute the length of the Longest Common Subsequence (LCS).

This is mostly for diagnostic purposed.

Returns:
int The length of the LCS.

Definition at line 725 of file DifferenceEngine.php.

Referenced by _check().

Diff::orig  ) 
 

Get the original set of lines.

This reconstructs the $from_lines parameter passed to the constructor.

Returns:
array The original sequence of strings.

Definition at line 742 of file DifferenceEngine.php.

References $lines.

Diff::reverse  ) 
 

Compute reversed Diff.

SYNOPSIS:

$diff = new Diff($lines1, $lines2); $rev = $diff->reverse();

Returns:
object A Diff object representing the inverse of the original diff.

Definition at line 696 of file DifferenceEngine.php.

Referenced by _check().


Member Data Documentation

Diff::$edits
 

Definition at line 670 of file DifferenceEngine.php.


The documentation for this class was generated from the following file:
Generated on Tue Jun 29 23:40:22 2004 for Mediawiki by doxygen 1.3.7