TYPO3
7.6
|
Public Member Functions | |
__construct (GranularityInterface $granularity) | |
getGranularity () | |
setGranularity (GranularityInterface $granularity) | |
getOpcodes () | |
setOpcodes (OpcodesInterface $opcodes) | |
parse ($from_text, $to_text) | |
Protected Member Functions | |
process ($from_text, $to_text) | |
diff ($from_text, $to_text, $delimiters) | |
charDiff ($from_text, $to_text) | |
extractFragments ($text, $delimiters) | |
Protected Attributes | |
$granularity | |
$opcodes | |
$from_text | |
$from_offset = 0 | |
$last_edit | |
$stackpointer = 0 | |
$edits = array() | |
Generates a set of instructions to convert one string to another.
Definition at line 31 of file Parser.php.
__construct | ( | GranularityInterface | $granularity | ) |
Creates an instance.
cogpowered\FineDiff\Granularity\GranularityInterface |
Implements ParserInterface.
Definition at line 71 of file Parser.php.
References Parser\$granularity.
|
protected |
Same as Parser::diff but tuned for character level granularity.
string | $from_text | |
string | $to_text |
Definition at line 346 of file Parser.php.
References Parser\$from_text.
Referenced by Parser\diff().
|
protected |
Core parsing function.
string | $from_text | |
string | $to_text | |
string | $delimiters | Delimiter to use for this parse. |
Definition at line 187 of file Parser.php.
References Parser\$from_text, Parser\charDiff(), and Parser\extractFragments().
Referenced by Parser\process().
|
protected |
Efficiently fragment the text into an array according to specified delimiters.
No delimiters means fragment into single character. The array indices are the offset of the fragments into the input string. A sentinel empty fragment is always added at the end. Careful: No check is performed as to the validity of the delimiters.
string | $text | |
string | $delimiters | |
array |
Definition at line 446 of file Parser.php.
Referenced by Parser\diff().
getGranularity | ( | ) |
Granularity the parser is working with.Default is cogpowered.
Implements ParserInterface.
Definition at line 82 of file Parser.php.
References Parser\$granularity.
getOpcodes | ( | ) |
Get the opcodes object that is used to store all the opcodes.
Implements ParserInterface.
Definition at line 98 of file Parser.php.
References Parser\$opcodes.
parse | ( | $from_text, | |
$to_text | |||
) |
Generates the opcodes needed to transform one string to another.
string | $from_text | |
string | $to_text |
cogpowered\FineDiff\Exceptions\GranularityCountException |
Implements ParserInterface.
Definition at line 114 of file Parser.php.
References Parser\$from_text, Parser\$opcodes, and Parser\process().
|
protected |
Actually kicks off the processing. Recursive function.
string | $from_text | |
string | $to_text |
Definition at line 143 of file Parser.php.
References Parser\$from_text, Parser\diff(), and elseif.
Referenced by Parser\parse().
setGranularity | ( | GranularityInterface | $granularity | ) |
Set the granularity that the parser is working with.
cogpowered\FineDiff\Granularity\GranularityInterface |
Implements ParserInterface.
Definition at line 90 of file Parser.php.
References Parser\$granularity.
setOpcodes | ( | OpcodesInterface | $opcodes | ) |
Set the opcodes object used to store all the opcodes for this parse.
cogpowered\FineDiff\Parser\OpcodesInterface | $opcodes,. |
Implements ParserInterface.
Definition at line 106 of file Parser.php.
References Parser\$opcodes.
|
protected |
Definition at line 66 of file Parser.php.
|
protected |
Definition at line 51 of file Parser.php.
|
protected |
Definition at line 46 of file Parser.php.
Referenced by Parser\charDiff(), Parser\diff(), Parser\parse(), and Parser\process().
|
protected |
Definition at line 36 of file Parser.php.
Referenced by Parser\__construct(), Parser\getGranularity(), and Parser\setGranularity().
|
protected |
Definition at line 56 of file Parser.php.
|
protected |
Definition at line 41 of file Parser.php.
Referenced by Parser\getOpcodes(), Parser\parse(), and Parser\setOpcodes().
|
protected |
Definition at line 61 of file Parser.php.