c++ - 在Doxygen中格式化参数

标签 c++ c++11 documentation doxygen

我正在使用此方法来记录我的方法:

/**
* Order beers from another player and add them into own inventory.
* @params from The Player who has to deliver the order
*/

void Player::order(const int numberOfBeers, Player &from)
{
    from.decreaseInventory(numberOfBeers);
    increaseInventory(numberOfBeers);
}

当我检查输出文件时,我得到的格式如下:
Order beers from another player and add them into own inventory. from The Player who has to deliver the order 

这看起来非常无组织。参数之间没有分隔。我该如何解决?

最佳答案

doxygen到ducument参数是\param而不是\ params (so without s)。
参见:http://doxygen.nl/manual/commands.html#cmdparam,摘录:

Starts a parameter description for a function parameter with name , followed by a description of the parameter. The existence of the parameter is checked and a warning is given if the documentation of this (or any other) parameter is missing or not present in the function declaration or definition.

The \param command has an optional attribute, dir, specifying the direction of the parameter. Possible values are "[in]", "[in,out]", and "[out]", note the [square] brackets in this description. When a parameter is both input and output, [in,out] is used as attribute.

The parameter description is a paragraph with no special internal structure. All visual enhancement commands may be used inside the paragraph.

Multiple adjacent \param commands will be joined into a single paragraph. Each parameter description will start on a new line. The \param description ends when a blank line or some other sectioning command is encountered.

关于c++ - 在Doxygen中格式化参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60673241/

相关文章:

c++ - 调用 alsa-lib 后启动时 VLC 音量错误

c++ - C++ 命名空间中的派生类中的 Qt 样式表(选择器)

c++ - 如何在没有某种数组的情况下输入多个值

c++ - 将 ostream 的内容复制到另一个 ostream

c++ - 将左值传递给用作临时std容器的模板参数的通用引用参数时与分配器相关的错误

c++ - 将enum类变量reinterpret_cast转换为基础类型的引用是否安全?

c++ - 如何简化这个冗余的 C++ 代码?

jquery - 有 jQuery 1.5 的 VSDoc 文件吗?

documentation - NUnit.Mocks 文档在哪里?

python - pydoc/help() 可以隐藏继承类方法和属性的文档吗?