使用doxygen生成接口api文档

Doxygen是一款强大的文档生成工具,支持Javadoc和Qt风格的代码注释。通过简单的命令行选项,你可以创建配置文件、更新现有配置、生成文档、布局模板以及样式表。它适用于C、C++等语言,帮助开发者自动生成高质量的API文档。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

符合doxygen格式的代码注释可以直接通过doxygen命令生成api文档:

# doxygen -h 
Doxygen version 1.8.5
Copyright Dimitri van Heesch 1997-2013

You can use doxygen in a number of ways:

1) Use doxygen to generate a template configuration file:
    doxygen [-s] -g [configName]

    If - is used for configName doxygen will write to standard output.

2) Use doxygen to update an old configuration file:
    doxygen [-s] -u [configName]

3) Use doxygen to generate documentation using an existing configuration file:
    doxygen [configName]

    If - is used for configName doxygen will read from standard input.

4) Use doxygen to generate a template file controlling the layout of the
   generated documentation:
    doxygen -l layoutFileName.xml

5) Use doxygen to generate a template style sheet file for RTF, HTML or Latex.
    RTF:        doxygen -w rtf styleSheetFile
    HTML:       doxygen -w html headerFile footerFile styleSheetFile [configFile]
    LaTeX:      doxygen -w latex headerFile footerFile styleSheetFile [configFile]

6) Use doxygen to generate an rtf extensions file
    RTF:   doxygen -e rtf extensionsFile

If -s is specified the comments of the configuration items in the config file will be omitted.
If configName is omitted `Doxyfile' will be used as a default.

其支持一下两种常用的style

  • Javadoc style
    You can use the Javadoc style, which consist of a C-style comment block starting with two *'s, like this:
/**
 * ... text ...
 */
  • Qt style
    or you can use the Qt style and add an exclamation mark (!) after the opening of a C-style comment block, as shown in this example:
/*!
 * ... text ...
 */

参考链接:
doxygen

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值