如何正确格式化类实例引用
How to properly format a class instance reference
我有这篇文档:
/**
* This method creates an import job for the given @arg item
*
* The default implementation should be suitable for most needs,
* it'll create an instance of @class ImportProjectJob
*
* @return a job that imports the project
*/
virtual KJob* createImportJob(ProjectFolderItem* item);
然而,@class
并不意味着要这样使用,并且在doxygen中没有类似@instanceof
的东西。我应该如何格式化这个?
根据Doxygen的自动链接生成规则,如果某些文档文本与已记录的类的名称匹配,并且该文本使用interCaps命名样式,则Doxygen将自动将该文本转换为指向该文档页面的链接。因此,如果你只使用"ImportProjectJob",Doxygen会找到那个类(如果它已经被文档化的话),并将文本转换为指向它的链接
但是,如果您的类/函数不使用interCaps命名,则可以通过@ref
:显式链接到文档实体
* The default implementation should be suitable for most needs,
* it'll create an instance of @ref ImportProjectJob
仅供参考:@arg
用于启动函数参数定义列表。类似于:
@arg @c AlignLeft left alignment.
@arg @c AlignCenter center alignment.
@arg @c AlignRight right alignment
您要查找的是@p
,它是用于引用参数名称等的内联格式。
只需使用@ref
而不是@class
,并记录声明它的类。
通常(默认情况下,即AUTOLINK_SUPPORT
为YES
时),甚至不需要显式引用它。Doxygen在检测到名称时会自动链接它。
顺便说一下,您对@arg
的使用并不像预期的那样。将@p
用于内联引用,将@param
用于记录方法参数。
/**
* @brief This method creates an import job for the given @p item
*
* @details The default implementation should be suitable for most needs,
* it'll create an instance of ImportProjectJob
*
* @param item this is a folder item
*
* @return a job that imports the project
*/
virtual KJob* createImportJob(ProjectFolderItem* item);
这就是声明CCD_ 13的地方:
/**
* @brief short desc of the class
*
* @details A long description
*/
class ImportProjectJob : public KJob
{};
相关文章:
- 对显式实例化的模板函数的未定义引用
- 重载运算符*以获取对另一个类的实例的引用
- 为什么我不能引用指向实例化对象的函数的指针?
- <Base> <Derived> 具有相同原始指针共享引用的 shared_ptr 和 shared_ptr 实例是否计数?
- 返回引用实例和非引用实例(return mystr & vs mystr)之间的区别是什么?
- 请参阅在 Visual Studio 2019 中捕获 std::exception 时对函数模板实例化消息的引用
- 将元组和整型实例合并到引用元组中
- C++ 为什么在定义的编译和链接之前引用外部实例的程序
- 是否允许使用初始值设定项列表将const数组引用实例化为构造函数参数
- 引用的静态强制转换强制模板实例化,其中不完整的类型很好
- 为什么不能在实例化对基类的引用的同时实例化指向派生类的指针?
- 非类型引用参数可以在运行时修改,这是否意味着模板可以在运行时实例化?
- 超出返回引用的单一实例生存期
- 反向函数不反转类实例化的引用字符串
- 通过引用将私有类实例传递到另一个类 C++ 的"get"函数中
- 多个实例保存对unique_ptr的引用
- 类模板实例化和通用引用
- 对从静态实例引用的类模板的静态成员的未定义引用
- 如何正确格式化类实例引用
- 如何在类构造函数中存储实例引用