CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2002
    Location
    Foggy California
    Posts
    1,245

    Looking for a specialized Diff tool

    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:
    Code:
    #ifndef CLASS_A_H
    #define CLASS_A_H
    Class A
    {
        int dummy1;
    };
    #endif
    File Version2:
    Code:
    #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:

    Code:
    ***OldFile.h***
    
    Class A
    {
        int dummy1;
    };
    
    ***NewFile.h***
    
    Class A
    {
        int dummy1;
        int dummy2;
    };
    Thanks,

    - Kevin

  2. #2
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652
    Well...'TotalCommander' has a diff tool included which basically displays it the following way...
    Code:
    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...

  3. #3
    Join Date
    Nov 2002
    Location
    Foggy California
    Posts
    1,245
    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

  4. #4
    Join Date
    Jan 2001
    Posts
    588
    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.

  5. #5
    Join Date
    Nov 2002
    Location
    Foggy California
    Posts
    1,245
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured