Doxygen文档说\ingroup可用于将实体添加到多个组:
\ingroup (<groupname> [<groupname> <groupname>])
问题是我尝试过,Doxygen将该实体添加到组列表中的最后一个组中。就像是
/** \ingroup A B
* ...
*/
将元素添加到模块A中,但不添加到模块B中。有人知道原因以及如何解决该问题吗?
我在Doxygen 1.7.6.1和1.8.1.2版本中进行了尝试。
谢谢你的帮助。
编辑:我意识到doxygen输出警告说:
Member X found in multiple @ingroup groups! The member will be put in group B, and not in group A
在我看来,这与文档矛盾。
回答:我回答自己。我试图将功能添加到多个组中,但是文档说:“请注意,复合实体(例如类,文件和 namespace )可以放入多个组中,但是成员(例如变量,函数,typedef和枚举)只能是一个一组成员”。
最佳答案
通常,您(对于允许的项目,比如说一个文件)只需要编写一个带倍数的ingroup组即可。为了完整起见,让我展示一下我使用的模板:
/**
* \file
* \ingroup GrpTest GrpLicense
* \brief Here your brief explanation
* \details And you put here a more detailed explanation to the
* contents of the file.
* \version 1.0
* \date 2014-09-27
* \author Dr Beco
* \par Webpage
* <<http://www.program.pg/>>
* \copyright (c) 2014 GNU GPL v3
* \note This program is free software: you can redistribute it
* and/or modify it under the terms of the
* GNU General Public License as published by
* the Free Software Foundation version 3 of the License.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program.
* If not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA. 02111-1307, USA.
* Or read it online at <<http://www.gnu.org/licenses/>>.
*
*/
现在,从Doxygen Documentation(特别是此处链接的页面)中,您将看到:
Note that compound entities (like classes, files and namespaces)
can be put into multiple groups,
but members (like variable, functions, typedefs and enums)
can only be a member of one group
该文档还说明了原因:
(this restriction is in place to avoid ambiguous linking
targets in case a member is not documented in the context
of its class, namespace or file, but only visible as part of a group).
因此,简而言之,不幸的是,您无法将函数(或为此未指定的所有类型的实体)添加到多个组。
我希望此链接可以帮助您解决更多问题。
关于grouping - Doxygen:如何在多个组中包含元素,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/16817596/