Doxygen 多行注释

1 c++ doxygen doxygen-wizard

我是 Doxygen 新手,正在尝试评论我的代码。

我对注释有一些问题:我的多行注释出现在一行中,我不想使用\\nor <br>

/** 
Brief - this is a function  
Get -  
Return -  
*/  
void func1()
{
    return
}
Run Code Online (Sandbox Code Playgroud)

我希望每一行都开始一个新行。

然而,结果是:

Brief - this is a function Get: - Return: - Post: -
Run Code Online (Sandbox Code Playgroud)

我也尝试过:

/// Brief - this is a function
/// Get -
/// Return -  
void func1()  
{
    return
}
Run Code Online (Sandbox Code Playgroud)

与上面提到的结果相同。

Cor*_*mer 7

在这种情况下,doxygen 注释旨在忽略隐式新行,因此文本换行不会影响输出,例如

/** This is a long comment that caused the
IDE to wrap the text and therefore
span onto multiple lines **/
int func(bool b) {
}
Run Code Online (Sandbox Code Playgroud)

但在你的例子中,我认为如果你的 doxygen 的每一行都有参数、返回值等语义含义,你应该使用适当的命令。

/**
\brief This is a description of my function
\param[in] b This is some bool argument of my function
\return This describes the int that is returned in this case
**/
int func(bool b) {
}
Run Code Online (Sandbox Code Playgroud)

请参阅此处的可用命令列表