I have cpp files peppered with comments such as the following before every function:

 *  @brief Set the normal and expansion handshake timeouts.
 *  @param wm               Array of wiimote_t structures.
 *  @param wiimotes         Number of objects in the wm array.
 *  @param normal_timeout   The timeout in milliseconds for a normal read.
 *  @param exp_timeout      The timeout in millisecondsd to wait for an expansion handshake.

I assume from the format that there has to be some way of exporting this into a "friendly" format, perhaps html, which can then be read in a manner similar to the Java API. How would I do this?

(I'm on Windows 7, running MS Visual Studio 2010)


The specific document comment style you quote is almost certainly intended for processing by Doxygen. It can generate decent quality documentation in several output formats from comments in sources of many C-like languages. There are also plugins available to process comments in some non-C languages for inclusion in the same document.

If you have the AT&T Graphviz tools installed and configure Doxygen to use them, then it can also draw a number of useful diagrams from the source code for inclusion in the documentation.

If the project is using Doxygen, then there is almost certainly a configuration file that specifies what source files to include, what formats to generate, and options related to the detailed processing. It would likely be named doxyfile, or something similar.

A common output format is the HTML for a complete web site. One example available online is the website for Doxygen itself, which is almost entirely generated by running Doxygen in its source tree.

  • I highly recommend Doxygen for projects written in C-like languages. The discipline of writing "good enough" comments is often useful, and provides a clear statement of the "contract" each function is offering to fulfill. – RBerteig Feb 24 '11 at 0:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.