c# 是否在.c文件中记录包含的头文件以及Doxygen注解?

o2g1uqev  于 2023-01-03  发布在  C#
关注(0)|答案(1)|浏览(176)

我注意到,当使用Doxygen来记录.c文件时,给定文件中包含的列表也包含在输出中,例如:
https://agnix.sourceforge.net/documentation/api/bridge_8c.html

现在,我通常要做的是在给定的“include块”(“intro comments”)之前包含一些一般性注解,然后在include行的同一行中包含一些特定的注解:

...
/*
* The following includes are required for 
* the code to compile:
*/

#include <stdio.h> // contains printf()
#include <netinet/in.h> // contains sockaddr_in
...

有没有可能为Doxygen格式化这些类型的注解(“intro注解”或“在同一行”-希望两者都有),以便我在那个.C文件的最终文档中得到它们的输出?
本质上,对于上面的例子,我会得到这样的输出(屏幕截图来自手动破解的HTML,以获得所需输出的模型):

(我想,这可以被看作是一种“字面编程”的方法)

avwztpqn

avwztpqn1#

如果你想让Doxygen识别一个文件并将其插入文档,你应该使用

/** <- (this format is recognized by Doxygen)
 * @file    name_of_file.h
 * 
 * @brief   What is
 * 
 * @author  You
 * 
 * @date    03/01/2023
 * 
 * @par     Put the title of the paragraph
 * Write the content of the paragraph
 */

在头文件的开头(注意:@file是必填项)。
另请参阅Doxygen guide

相关问题