ona  18.1.1
About: OpenNetAdmin provides a database managed inventory of your IP network (with Web and CLI interface).
  Fossies Dox: ona-18.1.1.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

Diff Class Reference
Inheritance diagram for Diff:
[legend]

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 492 of file DifferenceEngine.php.

Member Function Documentation

◆ _check()

Diff::_check (   $from_lines,
  $to_lines 
)

Check a Diff for validity.

This is here only for debugging purposes.

Definition at line 599 of file DifferenceEngine.php.

References closing(), E_USER_ERROR, lcs(), orig(), and reverse().

◆ closing()

Diff::closing ( )

Get the closing set of lines.

This reconstructs the $to_lines parameter passed to the constructor.

Returns
array The sequence of strings.

Reimplemented in WordLevelDiff.

Definition at line 584 of file DifferenceEngine.php.

Referenced by _check().

◆ Diff()

Diff::Diff (   $from_lines,
  $to_lines 
)

Constructor. Computes diff between sequences of strings.

Parameters
$from_linesarray An array of strings. (Typically these are lines from a file.)
$to_linesarray An array of strings.

Definition at line 504 of file DifferenceEngine.php.

References _DiffEngine\diff().

Referenced by MappedDiff\MappedDiff().

◆ isEmpty()

Diff::isEmpty ( )

Check for empty diff.

Returns
bool True iff two sequences were identical.

Definition at line 534 of file DifferenceEngine.php.

◆ lcs()

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 549 of file DifferenceEngine.php.

Referenced by _check().

◆ orig()

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.

Reimplemented in WordLevelDiff.

Definition at line 566 of file DifferenceEngine.php.

Referenced by _check().

◆ reverse()

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 520 of file DifferenceEngine.php.

Referenced by _check().

Member Data Documentation

◆ $edits

Diff::$edits

Definition at line 494 of file DifferenceEngine.php.

Referenced by MappedDiff\MappedDiff().


The documentation for this class was generated from the following file: