User:PerfektesChaos/WikidiffLX/coding

Implementation suggestions for WikidiffLX in C++ code.

Migration from Wikidiff2
The development was based on wikidiff2 (rev 84056).


 * wikidiff2.cpp
 * WikidiffLX.cpp – Re-written and extended.


 * wikidiff2.h
 * Split into WikidiffLX.h class and WDLX_config.h configuration.


 * Word.h
 * Moved into Word.cpp – extension changed, small amendments
 * Word.h – class declaration only


 * DiffEngine.cpp
 * Not changed.


 * DiffEngine.h
 * Name of include WikidiffLX.h adapted.

New files:


 * Line.cpp and Line.h
 * WDLX_config.h general configuration separated for integration, testing and debugging purposes.

op codes
The result of the diff engine is an amalgamated sequence of parts, containing the original from and to as well as a code op as follows. For lines this is displayed by yellow and green colour: Entire part absolutely unchanged. Number of parts between two neighbouring copy chunks unchanged and content differs. Count of parts between neighbouring copy chunks differs and another content; from has the greater number and this is attached to from while to is null. Count of parts between neighbouring copy</tt> chunks differs and another content; to</tt> has the greater number and this is attached to to</tt> while from</tt> is null.
 * copy</tt>
 * change</tt>
 * del</tt>
 * add</tt>

Note that from</tt> and to</tt> lines with the same op</tt> code are merged into arrays of pointers to line by diff engine.