gpt4 book ai didi

c++ - 如何使用 doxygen 将多个方法分组到一个类中?

转载 作者:太空宇宙 更新时间:2023-11-04 11:50:39 25 4
gpt4 key购买 nike

Doxygen 是一个非常好的c++ 代码文档工具。我想知道它是否具有将多个相关方法分组在一个类中并为它们提供含义注释的功能。例如:

class A : public B
{
public:
//// Begin group: Methods to implement class B's interface.

//! ...
void b1();

//! ...
void b1();

//// End group

};

组信息显示在doxygen生成的类文件中。谢谢。

最佳答案

您可以使用@name 标签来实现类似的功能。看看这个例子,这很简单。

/**
* @name Appends data to the container.
*
* @param tag Name of the data entry
* @param value Data value
*/
//@{
/**
* @brief Documentation for this overload
*/
void append(const std::string & tag, bool value);

/**
* @brief Documentation for this overload
*/
void append(const std::string & tag, int8_t value);

void append(const std::string & tag, int16_t value);
void append(const std::string & tag, int32_t value);
//@}

它产生以下输出: enter image description here

关于c++ - 如何使用 doxygen 将多个方法分组到一个类中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18433230/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com