ILIAS
Release_4_4_x_branch Revision 61816
|
Public Member Functions | |
Text_Diff ($from_lines, $to_lines) | |
Computes diffs between sequences of strings. | |
getDiff () | |
Returns the array of differences. | |
reverse () | |
Computes a reversed diff. | |
isEmpty () | |
Checks for an empty diff. | |
lcs () | |
Computes the length of the Longest Common Subsequence (LCS). | |
getOriginal () | |
Gets the original set of lines. | |
getFinal () | |
Gets the final set of lines. | |
_trimNewlines (&$line, $key) | |
Removes trailing newlines from a line of text. | |
_check ($from_lines, $to_lines) | |
Checks a diff for validity. |
Data Fields | |
$_edits |
Text_Diff::_check | ( | $from_lines, | |
$to_lines | |||
) |
Checks a diff for validity.
This is here only for debugging purposes.
Definition at line 165 of file Diff.php.
References getFinal(), getOriginal(), and reverse().
Text_Diff::_trimNewlines | ( | & | $line, |
$key | |||
) |
Text_Diff::getDiff | ( | ) |
Text_Diff::getFinal | ( | ) |
Gets the final set of lines.
This reconstructs the $to_lines parameter passed to the constructor.
Definition at line 137 of file Diff.php.
Referenced by _check().
Text_Diff::getOriginal | ( | ) |
Gets the original set of lines.
This reconstructs the $from_lines parameter passed to the constructor.
Definition at line 119 of file Diff.php.
Referenced by _check().
Text_Diff::isEmpty | ( | ) |
Checks for an empty diff.
Definition at line 84 of file Diff.php.
Text_Diff::lcs | ( | ) |
Computes the length of the Longest Common Subsequence (LCS).
This is mostly for diagnostic purposes.
Definition at line 101 of file Diff.php.
Text_Diff::reverse | ( | ) |
Computes a reversed diff.
Example: $diff = &new Text_Diff($lines1, $lines2); $rev = $diff->reverse();
Definition at line 68 of file Diff.php.
Referenced by _check().
Text_Diff::Text_Diff | ( | $from_lines, | |
$to_lines | |||
) |
Computes diffs between sequences of strings.
array | $from_lines | An array of strings. Typically these are lines from a file. |
array | $to_lines | An array of strings. |
Definition at line 32 of file Diff.php.
Referenced by Text_MappedDiff\Text_MappedDiff().