ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
DiffFormatter Class Reference
+ Inheritance diagram for DiffFormatter:
+ Collaboration diagram for DiffFormatter:

Public Member Functions

 format ($diff)
 Format a diff.
 _block ($xbeg, $xlen, $ybeg, $ylen, &$edits)
 _start_diff ()
 _end_diff ()
 _block_header ($xbeg, $xlen, $ybeg, $ylen)
 _start_block ($header)
 _end_block ()
 _lines ($lines, $prefix= ' ')
 _context ($lines)
 _added ($lines)
 _deleted ($lines)
 _changed ($orig, $closing)

Data Fields

 $leading_context_lines = 0
 Number of leading context "lines" to preserve.
 $trailing_context_lines = 0
 Number of trailing context "lines" to preserve.

Detailed Description

Definition at line 1391 of file class.WordLevelDiff.php.

Member Function Documentation

DiffFormatter::_added (   $lines)

Reimplemented in TableDiffFormatter.

Definition at line 1530 of file class.WordLevelDiff.php.

{
DiffFormatter::_block (   $xbeg,
  $xlen,
  $ybeg,
  $ylen,
$edits 
)

Definition at line 1475 of file class.WordLevelDiff.php.

{
$fname = 'DiffFormatter::_block';
//wfProfileIn( $fname );
$this->_start_block($this->_block_header($xbeg, $xlen, $ybeg, $ylen));
foreach ($edits as $edit) {
DiffFormatter::_block_header (   $xbeg,
  $xlen,
  $ybeg,
  $ylen 
)

Reimplemented in TableDiffFormatter.

Definition at line 1505 of file class.WordLevelDiff.php.

{
ob_start();
}
DiffFormatter::_changed (   $orig,
  $closing 
)

Reimplemented in TableDiffFormatter.

Definition at line 1537 of file class.WordLevelDiff.php.

{
$this->_lines($lines);
DiffFormatter::_context (   $lines)

Reimplemented in TableDiffFormatter.

Definition at line 1526 of file class.WordLevelDiff.php.

{
DiffFormatter::_deleted (   $lines)

Reimplemented in TableDiffFormatter.

Definition at line 1533 of file class.WordLevelDiff.php.

{
DiffFormatter::_end_block ( )

Reimplemented in TableDiffFormatter.

Definition at line 1518 of file class.WordLevelDiff.php.

{
DiffFormatter::_end_diff ( )

Definition at line 1499 of file class.WordLevelDiff.php.

{
DiffFormatter::_lines (   $lines,
  $prefix = ' ' 
)

Definition at line 1521 of file class.WordLevelDiff.php.

: 'd') : 'a') . $ybeg;
DiffFormatter::_start_block (   $header)

Reimplemented in TableDiffFormatter.

Definition at line 1514 of file class.WordLevelDiff.php.

{
DiffFormatter::_start_diff ( )

Definition at line 1495 of file class.WordLevelDiff.php.

{
DiffFormatter::format (   $diff)

Format a diff.

Parameters
$diffobject A Diff object.
Returns
string The formatted output.

Definition at line 1415 of file class.WordLevelDiff.php.

{
$fname = 'DiffFormatter::format';
//wfProfileIn( $fname );
$xi = $yi = 1;
$block = false;
$context = array();
$this->_start_diff();
foreach ($diff->edits as $edit) {
if ($edit->type == 'copy') {
if (is_array($block)) {
if (sizeof($edit->orig) <= $nlead + $ntrail) {
$block[] = $edit;
}
else{
if ($ntrail) {
$context = array_slice($edit->orig, 0, $ntrail);
$block[] = new _DiffOp_Copy($context);
}
$this->_block($x0, $ntrail + $xi - $x0,
$y0, $ntrail + $yi - $y0,
$block);
$block = false;
}
}
$context = $edit->orig;
}
else {
if (! is_array($block)) {
$context = array_slice($context, sizeof($context) - $nlead);
$x0 = $xi - sizeof($context);
$y0 = $yi - sizeof($context);
$block = array();
if ($context)
$block[] = new _DiffOp_Copy($context);
}
$block[] = $edit;
}
if ($edit->orig)

Field Documentation

DiffFormatter::$leading_context_lines = 0

Number of leading context "lines" to preserve.

This should be left at zero for this class, but subclasses may want to set this to other values.

Definition at line 1399 of file class.WordLevelDiff.php.

DiffFormatter::$trailing_context_lines = 0

Number of trailing context "lines" to preserve.

This should be left at zero for this class, but subclasses may want to set this to other values.

Definition at line 1407 of file class.WordLevelDiff.php.


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