PDA

View Full Version : GNU diffutils?



goes2bob
26th July 2007, 05:01
I am trying to create a "pretty" diff tool that uses the GNUWin32 diffutils. Color a lines that differs between two versions of the same file, another color for added lines to a file etc. I am not sure how to approach using the GNU tool within a QT4 program. I have a simple GUI, but I do not have any ideas about how to invoke the "diff" command of the tool OR how to use the output that the diffUtils will return.
I am developing for Windows, which "diff -y <directory1> <directory2>" in a dos shell produces an output like this:

1416

where the "|" says that the lines are different , and ">" says that a line has been added to the file on the right.
First Post, feeling the water (please be gentle) ;)

marcel
26th July 2007, 05:17
You will have to use QProcess to run diff or any other tool.
Also, with QProcess, you can read the stdout of the process in a buffer.

You will still have to create a parser for that output.

Also, you are not necessarily obligated to use diff. A much easier way would be to "look" at the sources of WinMerge(www.winmerge.org), or any other open source diff tool, even"diff".

Regards