【问题标题】:How to group a number of methods in a class with doxygen?如何用 doxygen 对一个类中的多个方法进行分组?
【发布时间】:2013-08-25 20:12:55
【问题描述】:

Doxygen 是一个非常好的 c++ 代码文档工具。我想知道它是否具有将许多相关方法分组到一个类中并赋予它们意义的功能 cmets。例如:

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

    //! ...
    void b1();

    //! ...
    void b1();

    //// End group

};

并且组信息显示在 doxygen 生成的类文档中。谢谢。

【问题讨论】:

    标签: c++ doxygen


    【解决方案1】:

    您可以使用@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);
    //@}
    

    它产生以下输出:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-07-20
      • 1970-01-01
      • 2023-02-14
      • 1970-01-01
      • 2019-08-31
      • 2019-09-01
      • 2020-08-24
      相关资源
      最近更新 更多