当前位置: 首页 > news >正文

doxygen c++ 语法

c++基本语法模板

/*! 开头, */ 结尾

/*!\关键字1\关键字2
*/

1 文件头部信息

/*! \file ClassA.h*  \brief     文件说明 定义了类fatherA*  \details   This class is used to demonstrate a number of section commands.*  \author    John Doe*  \author    Jan Doe*  \version   4.1a*  \date      2023-2199*  \pre       First initialize the system.*  \bug       Not all memory is freed when deleting an object of this class.*  \warning   Improper use can crash your application*  \copyright GNU Public License.*/

2 class

/*! \class Test classA.h "inc/classA.h"\brief fatherA类Some details about the Test class.*/

2 变量

/*! \var int errno\brief Contains the last error code.\warning Not thread safe!
*/

3 函数

例子1

/*! \fn int read(int fd,char *buf,size_t count)\brief Read bytes from a file descriptor.\param fd The descriptor to read from.\param buf The buffer to read into.\param count The number of bytes to read.
*/

例子2

/*! \fn void Overload_Test::drawRect(int x,int y,int w,int h)* This command draws a rectangle with a left upper corner at ( \a x , \a y ),* width \a w and height \a h. */

在这里插入图片描述
例子3

class Fn_Test
{public:const char *member(char,int) throw(std::out_of_range);
};const char *Fn_Test::member(char c,int n) throw(std::out_of_range) {}/*! \class Fn_Test* \brief Fn_Test class.** Details about Fn_Test.*//*! \fn const char *Fn_Test::member(char c,int n) *  \brief A member function.*  \param c a character.*  \param n an integer.*  \exception std::out_of_range parameter is out of range.*  \return a character pointer.*/

在这里插入图片描述

4 重载

/*!* \overload void Overload_Test::drawRect(const Rect &r)*/

5 结构体

/*! \struct CoordStruct* A coordinate pair.*/
struct CoordStruct
{/*! The x coordinate */float x;/*! The y coordinate */float y;
};

在这里插入图片描述

6 枚举

class Enum_Test
{public:enum TEnum { Val1, Val2 };/*! Another enum, with inline docs */enum AnotherEnum { V1, /*!< value 1 */V2  /*!< value 2 */};
};/*! \class Enum_Test* The class description.*//*! \enum Enum_Test::TEnum* A description of the enum type.*//*! \var Enum_Test::TEnum Enum_Test::Val1* The description of the first enum value.*/

在这里插入图片描述

7 宏

/*! \brief Computes the absolute value of its argument \a x.\param x input value.\returns absolute value of \a x.
*/
#define ABS(x) (((x)>0)?(x):-(x))/*!\def MAX(x,y)Computes the maximum of \a x and \a y.
*/
#define MAX(x,y) ((x)>(y)?(x):(y))

在这里插入图片描述
还有其他关键字,就不一一列举了:
手册里面有详细说明,并有例子
在这里插入图片描述

http://www.lryc.cn/news/172795.html

相关文章:

  • ChatGLM微调基于P-Tuning/LoRA/Full parameter(上)
  • BLE Mesh蓝牙mesh传输大数据包传输文件照片等大数据量通讯
  • 9.18 QT作业
  • 【100天精通Python】Day67:Python可视化_Matplotlib 绘动画,2D、3D 动画 示例+代码
  • Linux内核源码分析 (B.x)Linux页表的映射
  • 机器学习(15)---代价函数、损失函数和目标函数详解
  • 计算机专业大学规划之双非
  • 2.策略模式
  • 算法通过村第七关-树(递归/二叉树遍历)黄金笔记|迭代遍历
  • MySQL数据库简介+库表管理操作+数据库用户管理
  • PyTorch实战:卷积神经网络详解+Python实现卷积神经网络Cifar10彩色图片分类
  • MapRdeuce工作原理
  • 完整指南:使用JavaScript从零开始构建中国象棋游戏
  • PG-DBA培训19:PostgreSQL高可用集群项目实战之Patroni
  • 数据库管理-第105期 安装Database Valut组件(20230919)
  • 企望制造ERP系统RCE漏洞 复现
  • 【unity小技巧】Unity 存储存档保存——PlayerPrefs、JsonUtility和MySQL数据库的使用
  • 2023-9-22 滑雪
  • 基于Yolov8的工业小目标缺陷检测(6):多检测头结合小缺陷到大缺陷一网打尽的轻量级目标检测器GiraffeDet,暴力提升工业小目标缺陷检测能力
  • exe文件运行后无输出直接闪退如何找解决办法
  • OpenHarmony应用开发—ArkUI组件集合
  • Linux(CentOS)安装msf
  • 工作几年还是悟不懂自动化测试的意义
  • Redis面试问题三什么是缓存雪崩怎么解决
  • 【Unittest】自动化测试框架核心要素
  • Hyperloglog
  • 如何自动获取短信验证码?
  • Linux 本地 Docker Registry本地镜像仓库远程连接【内网穿透】
  • 基于Yolov8的工业小目标缺陷检测(4):SPD-Conv,低分辨率图像和小物体涨点明显
  • 平均精度(AP)