Click to See Complete Forum and Search --> : Looking for a specialized Diff tool


KevinHall
February 20th, 2003, 03:56 PM
Does anyone know if a diff tool exists that will display the class/struct definition or function prototype if something changes:

For Example --

File Version1:

#ifndef CLASS_A_H
#define CLASS_A_H
Class A
{
int dummy1;
};
#endif

File Version2:

#ifndef CLASS_A_H
#define CLASS_A_H
Class A
{
int dummy1;
int dummy2;
};
#endif


Most diff tools will report that a line was inserted in version 2 of the file and report where and what that line was.

What I'm looking for is something like the following so it will be more readable:


***OldFile.h***

Class A
{
int dummy1;
};

***NewFile.h***

Class A
{
int dummy1;
int dummy2;
};


Thanks,

- Kevin

Andreas Masur
February 20th, 2003, 04:34 PM
Well...'TotalCommander' (http://www.ghisler.com) has a diff tool included which basically displays it the following way...

Class A | Class A
{ | {
int dummy1; | int dummy1;
| int dummy2;
}; | };

It also displays the line numbers etc. It is of course not a separate diff tool but rather a complete file manager (which actually is pretty nice and powerful). It is shareware however you can fully use it except that you have to press a button at startup...

KevinHall
February 20th, 2003, 04:41 PM
Thanks. Actually though, I'm looking for a diff tool that will produce a text file (preferably from the command line). My company is trying to automate the creation of a master diff file for 100+ sources that will be in a readable format for internal developers as well as our customers.

Thanks again!

- Kevin

Bob Davis
February 20th, 2003, 06:05 PM
If you're asking for what I'm thinking, wouldn't it be a trivial thing to code up? Is it just a line-by-line comparison, or something more sophisticated? If it's the former, that shouldn't take but 10 minutes. :)

KevinHall
February 20th, 2003, 06:18 PM
It's a little more sophisticated... especially when you consider the possibility of embedded classes. Anyway, I am thinking about doing something minimal that will suit our immediate needs using Python (it has excellent and easy to use regular expression support) -- perhaps I'll try C+; the STL should be able to easily do what I want... hmmmm.....

Anyway, I was just hoping someone else might have already developed something like this so I wouldn't have to spend the time to do it myself. And I have a feeling this will still take a decent chunk of time (mostly b/c of the logic design).

Thanks anyway guys!

- Kevin