tags:

views:

395

answers:

2

Hello, i'm developing a quite big C++ software and now (better late than neve :)) i've decided to document it in the doxy standards. There are plenty of classes, methods, functions, macros and so on therefore i'm searching for a software that would scan my source tree and insert doxy comment blocks on top of every "documentable item" to let me edit them later and add details such as methods description and so on.

Some hint?

edit

I'm under GNU/Linux with Code::Blocks IDE, so no VisualStudio plugins needed .

A: 

You can set Doxygen to extract non-documented items as well - that may do what you want without adding ANY comment blocks to the code yet.

After that you can create templates / macros (depends on your IDE) to create pre-formatted blocks for each type of item, as you slowly work through the code documenting items one by one.

[edit] If you're using Visual Studio, some introspection is available on the classes and other constructs in the file, that may help. Alternatively take a look at Doxycomment - it might be some of what you want.

MadKeithV
I'm aware of that feature, but i prefer to have those comments in the source code.
Simone Margaritelli
Well you can easily create *empty* templates for the blocks you would like to add. Getting some data into those templates automatically might be trickier - but check out Doxycomment.
MadKeithV
I'm under GNU/Linux with Code::Blocks IDE, so no VisualStudio plugins needed .
Simone Margaritelli
@Simone Doxy comments that simply reproduce what Doxygen can generate without them would seem to be redundant, to say the least.
anon
+1  A: 

I am quite perplex here.

What is the goal of automatically generating comments ?

Comments are meant to bring additional value:

/**
 * \brief: finds the person based on its name
 * \param: name, the name of the person
 * \result: the person
 */
Person findPerson(Name name);

Is nothing but code clutter that clog my valuable screen estate. And that's about as much as can be generated automatically unfortunately... Notice in particular that I have no idea of what happens if ever the function does not find the person, which certainly seems likely: does it abort ? throws ? (what... ?) returns a default constructed object ?

On the other hand:

///
/// Try an exact match approach to begin with
/// Uses the double metaphone algorithm
///   if none was found as we have
///   a western european clientele
///
Person findPerson(Name name)
{
}

is much more interesting!

  • Now I know what is this strange collection of if that seems to be performing some kind of sound recognition...
  • I know its name so I can look it up on Internet to check its implementation (functionality)
  • And I know why it was selected and thus when I should reevaluate its use (fits a western european clientele so if we develop on arabic market it'll need adaptation...)

Unfortunately, that's not going to be generated automatically.

Matthieu M.
I think that question is very valuable. In a good project, there are plenty of comments all over, as most routines can be expected to be non-trivial. For a person about to learn or maintain the code, each single (intelligent) line is valuable.In case you have, say, 30.000 lines of barely and badly documented code, such a small tool as requested by the author can be a bliss, if you want to read throught the code and create a documentation by yourself.