Doxygen:如何在多个组中包含元素

问题描述 投票:9回答:2

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

在我看来,这与文档相矛盾。

答案:我自己回答。我试图将函数添加到多个组,但文档说“注意复合实体(如类,文件和命名空间)可以放在多个组中,但成员(如变量,函数,typedef和枚举)只能是一个一组成员“。

grouping doxygen
2个回答
8
投票

您通常(对于允许的项目,比方说文件)只需要编写具有多个组的内组。为了完整起见,让我展示一下我使用的模板:

/**
 * \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).

因此,简而言之,遗憾的是,您无法将多个组添加一个函数(或各种实体,就像您未指定的那样)。

我希望这个链接可以帮助您解决更多问题。


2
投票

用于

/** \ingroup A B
 * ...
 */

只有在其他地方定义时才会将项目添加到组AB。如果未定义组,则不会仅仅因为它在\ingroup命令中使用而定义。

你应该能够通过使用获得组B中的项目

/** \defgroup B
 * @{
 * @}
 */
/** \ingroup A B
 * ...
 */
© www.soinside.com 2019 - 2024. All rights reserved.