views:

109

answers:

5

I have inherited a large-ish application written in C++ on Linux. Is there an easy way to get a report of each class and the public methods exposed in each class?

I've looked at Doxygen, but that appears to just provide easy browsing of the codebase, not tailored for providing anything that can be exported to Excel, etc.

+8  A: 

I think you have given up on doxygen to early ;-)

Whenever I start with a new code. It has been my standard routing to generate full Doxygen documentation, it proved an invaluable tool in getting up to speed with unknown code. Besides producing a browsable code it also generates a dictionary of methods and members for all the classes and files.

There is also a cross reference between classes and functions
no other tool I tried, including pay-ware, was better than doxygen.

My advice : play a bit with the configuration file and try again.

Alon
Moreover, if you have to use the parsed class structure in another application the Doxygen tagfiles are invaluable.
Matteo Italia
A: 

You can parse C++ files and build the report. It's easier than it sounds :) Try ANTLR parsers generator. It already has C++ grammar.

Alexey Kalmykov
A: 

A simple way to get a list of public symbols is to use the nm utility, with de-mangling switched on.

Clifford
A: 

Take a look at GCCXML, which gives you type information from gcc in a relatively clear XML format. Extracting the relevant types and pushing them into other XML formats (like Excels XML) shouldn't be too hard.

Georg Fritzsche
A: 

I suggest that you research your compiler and linker parameters to see if either one can generate a cross reference. You could also use the map generated by the linker.

Thomas Matthews