Results 1 to 2 of 2

Thread: GNU diffutils?

  1. #1
    Join Date
    Jul 2007
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows

    Default GNU diffutils?

    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:

    code1.JPG

    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)
    Last edited by goes2bob; 26th July 2007 at 05:09.

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: GNU diffutils?

    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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.