是否可以使用Doxygen在C ++的函数中适当地记录局部变量? [英] Is it possible to suitably document local variables within functions in C++, using Doxygen?

查看:148
本文介绍了是否可以使用Doxygen在C ++的函数中适当地记录局部变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,在我的函数

//starting code with doxygen documentation
/** The main function. I will now try to document variables within this main function*/
int main()
{
 int arr[]; /** \brief an integer array*/
 .....
 return 0;
}
//end of code

但是,当我使用doxygen在配置文件中将HIDE_IN_BODY_DOCS变量设置为NO,则不会为此本地变量执行特定的文档。相反,它只是需要这个位,并打印它与函数文档,好像是任何其他注释行内的函数

However, when I use doxygen with the "HIDE_IN_BODY_DOCS" variable set to "NO" in the configuration file, this does not perform specific documentation for this local variable. Rather, it just takes that bit and prints it along with the function documentation, as if it were any other comment line within the function

有任何方法正确使用doxygen记录这样的局部变量?

Is there any way to "properly" document such local variables using doxygen?

推荐答案

我不知道有办法做到这一点办法)。记住,doxygen是为了记录类和函数头,即接口。将文档看作其他程序员为了正确使用您的类和函数而研究的东西。你不应该使用doxygen记录你的实现。然而,由于你在C(++)中编程,在源文档中记录局部变量不应该是一个问题。只要给它一个正确的名称或在源文档:

I do not know a way to do that (and I do doubt that there exists a way). Remember, that doxygen was made to document classes and function headers, i.e. the interface. Think of the documentation as something that other programmers study in order to use your classes and functions properly. You shouldn't use doxygen to document your implementation. However, as you are programming in C(++), it should not be a problem to document local variables in source. Just give it a proper name or document it "in source":

Cat cats []; //持有一堆猫

在定义所有变量的语言中,必须在函数开头声明(Delphi,Pascal ),你需要的系统会有意义。

In languages where you define all your variables must be declared at the beginning of your function(Delp Pascal), the system demanded by you would make sense though.

这篇关于是否可以使用Doxygen在C ++的函数中适当地记录局部变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆