Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

doxygen function parameter documentation (//!< vs @param)

Tags:

doxygen

If I use "after the member" documentation for function parameters, for example, use //!< after each parameter, instead of @param in the header, the "Parameters" section is always placed after "Return" in the generated output file.

Is is possible to define the order so that "Parameters" will be placed before "Return"?

/**
 *****************************************************************************************
 *  @brief      Test API
 *
 *  @usage      This API can be called at any time
 *
 *  @return     0 if successful; or 1 if failed
 ****************************************************************************************/

int TestAPI(
    int argument1,       //!< first argument
    int argument2        //!< second argument
    );
like image 363
user313031 Avatar asked Oct 17 '11 22:10

user313031


People also ask

What is @brief in doxygen?

Putting the command @brief will generate a short description of the function when you generate the doxygen documentation. That short description can be extended if you want.

What is doxygen documentation?

Doxygen (/ˈdɒksidʒən/ DOK-see-jən) is a documentation generator and static analysis tool for software source trees. When used as a documentation generator, Doxygen extracts information from specially-formatted comments within the code.

How do I comment out a code in doxygen C++?

Once specified, you can generate the comment stub by typing the respective “///” or “/**” above a function, or by using the (Ctrl+/) shortcut.


1 Answers

I've just tried out your code with Doxygen 1.7.5.1, and confirmed that with your code, the Parameter list in the output comes after the description of Return.

This is a shame, as the //!< style is much nicer than having to re-state the names of all the parameters with @param:

/**
 *****************************************************************************************
 *  @brief      Test API
 *
 *  @usage      This API can be called at any time
 * 
 *  @param      argument1 first argument
 *  @param      argument2 second argument
 *
 *  @return     0 if successful; or 1 if failed
 ****************************************************************************************/

int TestAPI2(
    int argument1,
    int argument2
    );

I had a look in the Doxygen Bugzilla bug database, to see if it was a relatively recent bug (as then you could try reverting to an older installation).

I believe you've found Doxygen Bug 316311: 'parameter documentation after return documentation by using inline comments', which was reported in September 2005, and hasn't been fixed.

So, sadly, I'm afraid the answer to your question Is is possible to define the order so that "Parameters" will be placed before "Return"? is almost certainly No.

Edit

I've just added a note to Doxygen Bug 316311, asking for it to be changed to Status=CONFIRMED.

like image 166
Clare Macrae Avatar answered Sep 20 '22 12:09

Clare Macrae