首页 > 解决方案 > 如何在 doxygen 中显示 C++ 样式包含语法

问题描述

我将 doxygen 评论放在我的文件中。当我生成 HTML 文件(使用 doxygen 应用程序)时,我可以看到

MyClass 类参考

#include <myclass.hpp>

我想像这样显示

MyClass 类参考

#include <MyClass>

我尝试了各种选择,但没有运气。我尝试了 \file MyClass,但仍然显示相同的(上面提到的)行。

这是 doxygen 评论

/**
 * \class MyClass
 *
 * \ingroup demo
 *
 * \brief Provide an example
 *
 * This class is meant as an example.  It is not useful by itself
 * rather its usefulness is only a function of how much it helps
 * the reader.  It is in a sense defined by the person who reads it
 * and otherwise does not exist in any real form. 
 *
 * \file MyClass
 *
 * Contact: abc@abc.com
 *
 * Created on: Wed Apr 13 18:39:37 2005
 *
 */

标签: c++doxygen

解决方案


来自Doxygen 常见问题解答

您还可以按如下方式记录您的课程

/*! \class MyClassName include.h path/include.h
 *
 *  Docs for MyClassName
 */

使 doxygen 放

#include <path/include.h>

在 MyClassName 类的文档中,无论包含 MyClassName 定义的实际头文件的名称如何。

所以我会尝试:

/**
* \class MyClass myclass.hpp MyClass
...
*/

推荐阅读