【问题标题】:How to have Doxygen only generate documentation for methods that have a comment如何让 Doxygen 只为有注释的方法生成文档
【发布时间】:2015-10-26 08:18:34
【问题描述】:

我想生成我程序中各种类的 Save-Method 生成的某些参数的文档。为此,我想在我的 save 方法的顶部写一个注释,这些 cmets 应该转到一个 html 和 PDF 文件。

我想使用 doxygen 来解析我的 C++ 项目的源文件和头文件,但是默认情况下,doxygen 会为我的项目中的所有成员和类生成一个文档,这不是我真正想要的。

是否可以自定义 doxygen 以仅为一个方法生成文档,该方法始终具有相同的签名和名称 (int Save();),仅此而已?如何实现?

【问题讨论】:

  • 是否也记录了其他类/方法?除非设置了 EXTRACT_ALL,否则 Doxygen 只会为记录的成员生成文档。

标签: c++ documentation doxygen


【解决方案1】:

您看过ENABLED_SECTIONS 和cond 命令吗?这是示例的 sn-p:

/// @cond DEV
/*
 *  The implementation of the interface
 */
class Implementation : public Intf
{
  public:
    void func();

    /// @cond TEST
    void test();
    /// @endcond

    /// @cond
    /** This method is obsolete and does
     *  not show up in the documentation.
     */
    void obsolete();
    /// @endcond
};

/// @endcond

根据 ENABLED_SECTIONS 是包含 TEST 还是 DEV,输出会有所不同。

如果这没有帮助,请澄清您的问题。

【讨论】:

    猜你喜欢
    • 2012-03-26
    • 2023-03-12
    • 2018-11-23
    • 1970-01-01
    • 2020-06-17
    • 1970-01-01
    • 2016-12-07
    • 1970-01-01
    • 2014-08-09
    相关资源
    最近更新 更多