Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Public Attributes | List of all members
ouwiki_changes Class Reference

A more logical representation of the results from ouwiki_internal_diff() More...

Public Member Functions

 __construct ($diff, $count2)
 
 internal_find_deletes ($diff, $count2)
 Find deleted lines. More...
 
 ouwiki_changes ($diff, $count2)
 Old syntax of class constructor. More...
 

Public Attributes

 $adds
 Array of indexes (in file 2) of added lines.
 
 $changes
 Array of changed ranges.
 
 $deletes
 Array of indexes (in file 1) of deleted lines.
 

Detailed Description

A more logical representation of the results from ouwiki_internal_diff()

Constructor & Destructor Documentation

◆ __construct()

ouwiki_changes::__construct (   $diff,
  $count2 
)
Parameters
array$diffArray from line indices in file1 to indices in file2. All indices 1-based.
int$count2Number of lines in file2

Member Function Documentation

◆ internal_find_deletes()

ouwiki_changes::internal_find_deletes (   $diff,
  $count2 
)

Find deleted lines.

These are lines in file1 that cannot be present even in modified form in file2 because we have matching lines around them. O(n) algorithm.

Parameters
array$diffArray of file1->file2 indexes
int$count2Count of lines in file2

◆ ouwiki_changes()

ouwiki_changes::ouwiki_changes (   $diff,
  $count2 
)

Old syntax of class constructor.

Deprecated in PHP7.

Deprecated:
since Moodle 3.1

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