简体   繁体   English

在Doxygen中记录C ++别名

[英]Documenting C++ aliases in Doxygen

With the appropriate comment in front of it, Doxygen generates entries for class , struct and namespace declarations but not occurrences of typedef or using . 在Doxygen前面加上适当的注释后,它会为classstructnamespace声明生成条目,但不会出现typedefusing

In this example 在这个例子中

/// here is my typedef
typedef int MyTypedef;

/// here is my namespace
namespace MyNamespace 
{
  /// here is my other typedef
  typedef int MyOtherTypedef;
}

I get an entry in the documentation for MyNamespace and even MyOtherTypedef but there is nothing for MyTypedef . 我在MyNamespace甚至MyOtherTypedef的文档中MyNamespace一个条目,但是MyTypedef没有任何MyTypedef Why not? 为什么不?

The answer is the same as the answers to why entries for functions and preprocessor definitions are not automatically generated. 答案与为什么不自动生成函数预处理程序定义条目的答案相同。

Doxygen considers aliases, variables, functions and macros (but not classes or namespaces) to be 'objects'. Doxygen将别名,变量,函数和宏(而不是类或名称空间)视为“对象”。 And all 'objects' are documented iff their containing file, class or namespace is also documented. 和所有的“对象”都记录IFF其包含的文件,类或命名空间也被记录在案。

For MyTypedef to feature in your documentation, add: 为了使MyTypedef出现在您的文档中,请添加:

/// \file
/// here is my file

anywhere in the global scope of your file. 文件全局范围内的任何位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM