Comments: on this page. Click to read or post your own.

Class Diff

Description

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

Located in /cms/code/Diff.php (line 530)


	
			
Direct descendents
Class Description
MappedDiff Computes diff between sequences of strings.
Variable Summary
mixed $edits
Method Summary
static void compareHTML ( $from,  $to)
static void getHTMLChunks ( $content)
Diff Diff ($from_lines $from_lines, $to_lines $to_lines)
array finaltext ()
bool isEmpty ()
int lcs ()
array orig ()
object A reverse ()
void _check ( $from_lines,  $to_lines)
Variables
mixed $edits (line 532)
Methods
static method compareHTML (line 663)
static void compareHTML ( $from,  $to)
  • $from
  • $to
static method getHTMLChunks (line 753)
static void getHTMLChunks ( $content)
  • $content
Constructor Diff (line 542)

Constructor.

Computes diff between sequences of strings.

Diff Diff ($from_lines $from_lines, $to_lines $to_lines)
  • $from_lines $from_lines: array An array of strings. (Typically these are lines from a file.)
  • $to_lines $to_lines: array An array of strings.
finaltext (line 622)

Get the final set of lines.

This reconstructs the $to_lines parameter passed to the constructor.

  • return: The sequence of strings.
array finaltext ()
isEmpty (line 572)

Check for empty diff.

  • return: True iff two sequences were identical.
bool isEmpty ()
lcs (line 587)

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

This is mostly for diagnostic purposed.

  • return: The length of the LCS.
int lcs ()
orig (line 604)

Get the original set of lines.

This reconstructs the $from_lines parameter passed to the constructor.

  • return: The original sequence of strings.
array orig ()
reverse (line 558)

Compute reversed Diff.

SYNOPSIS:

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

  • return: Diff object representing the inverse of the original diff.
object A reverse ()
_check (line 637)

Check a Diff for validity.

This is here only for debugging purposes.

void _check ( $from_lines,  $to_lines)
  • $from_lines
  • $to_lines
blog comments powered by Disqus

Documentation generated on Tue, 07 Oct 2008 15:56:29 +1300 by phpDocumentor 1.3.2