User:PerfektesChaos/WikidiffLX/coding/WikidiffLX.cpp

Based on wikidiff2/wikidiff2.cpp (rev 83886 Mar 2011).

Declarations in WikidiffLX.h


 * Renamed following the new generation name
 * Added many methods

execute
Based on wikidiff2 with following changes: Major task controlling line separation, diff engine, postprocessing engine result, formatting HTML.
 * merged with former diffLines
 * delegating HTML output to printLines

diffResult
New methodology for postprocessing of virtual lines. Result of engine is transferred from LineDiff into Line objects. Note that the two LineVector collections are accessed by their pointers in DiffOp.

diffWhitespace
New methodology for trailing whitespace at end of line and invisible trailing lines. Major part of work is done within Line objects.

explodeLines
Based on explodeLines in wikidiff2 but recognizing breaks of virtual lines. Detect invisible trailing lines, separate from lines with visible content and hide them in Line objects.

explodeWords
Based on explodeWords in wikidiff2 but completely rewritten and accelerated. Handling of Unicode spaces introduced. Thai processing started only if really Thai character. Every CJK symbolis treated as single word now.

explodeWordsThai
Re-written procedure for handling of substring containing thai characters only in Thai line splitting into words within explodeWords.

findVirtualBreak
New method for detection of breaks of virtual lines within explodeLines.

nextUtf8Char
Based on wikidiff2 but demanding 32bit characters explicitly.

printLines
Mainly new code for the presentation of paragraphs. The respective diffLines procedure in wikidiff2 is replaced by printLines. Handling of virtual line sequences is implemented by filling table cells until hard break encountered. Trailing invisible lines are discovered and presented as table cells where necessary.

printText
Based on wikidiff2.
 * Use printText unchanged.
 * Added printTextRed</tt> basically like printText</tt> but visualize zero-width differences within a red word.

printWordDiff
Based on wikidiff2.
 * Added printWordDiffSideBlack</tt>
 * Modified printWordDiffSide</tt> to reflect whether both adjacent words are black and shall present whitespace differences.

recoverParagraphs
New methodology for postprocessing of virtual lines.
 * Precondition: virtual lines might change op code within paragraph
 * Postcondition: every paragraph has a unique op code