vscode 配置doxygen注释和snippet

vscode 配置doxygen注释和snippet

Doxygen的C/C++注释原则

基于Doxygen的C/C++注释原则
标注总述
1.文件头标注
2. 命名空间标注
3. 类、结构、枚举标注
4. 函数注释原则
5. 变量注释
6. 模块标注
7. 分组标注

指令表格

命令 字段名 语法
@file 文件名 file [< name >]
@brief 简介 brief { brief description }
@author 作者 author { list of authors }
@mainpage 主页信息 mainpage [(title)]
@date 年-月-日 date { date description }
@author 版本号 version { version number }
@copyright 版权 copyright { copyright description }
@param 参数 param [(dir)] < parameter-name> { parameter description }
@return 返回 return { description of the return value }
@retval 返回值 retval { description }
@bug 漏洞 bug { bug description }
@details 细节 details { detailed description }
@pre 前提条件 pre { description of the precondition }
@see 参考 see { references }
@link 连接(与@see类库,{@link www.google.com}) link < link-object>
@sa 参考资料 @sa < link-object>
@throw 异常描述 throw < exception-object> { exception description }
@todo 待处理 todo { paragraph describing what is to be done }
@warning 警告信息 warning { warning message }
@deprecated 弃用说明。可用于描述替代方案,预期寿命等 deprecated { description }
@example 弃用说明。可用于描述替代方案,预期寿命等 deprecated { description }
@var、@enum、@struct、@class 对变量、枚举、结构体、类等进行标注

以下是常用的

image-20250509155113680

文件注释

/**
 * @file 文件名
 * @brief 简介
 * @details 细节
 * @author 作者
 * @version 版本号
 * @date 年-月-日
 * @copyright 版权
 */

example:

image-20250509151935308

还有一种是这样

/*****************************************************************************
*  heschat                                                        
*  Copyright (C) 2025 hesphoros <hesphoros@gmail.con>
*                                                                           
*  This file is part of heschat.                                  
*                                                                           
*  This program is free software; you can redistribute it and/or modify    
*  it under the terms of the GNU General Public License version 3 as       
*  published by the Free Software Foundation.                              
*                                                                           
*  You should have received a copy of the GNU General Public License       
*  along with this program. If not, see <http://www.gnu.org/licenses/>.    
*                                                                           
*  @file     Border.cpp                                                
*  @brief    Border class implementation file                                                  
*  @details  None                                                 
*                                                                           
*  @author   hesphoros                                                
*  @email    hesphoros@gmail.con                                   
*  @version  1.0.0.1                                                       
*  @date     2025/05/09             
*  @license  GNU General Public License (GPL)                              
*---------------------------------------------------------------------------*
*  Remark         : 说明备注                                          
*---------------------------------------------------------------------------*
*  Chang
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

hesphoros

你的鼓励是我最大的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值