c - 如何使 doxygen 预处理器递归到子目录中?

标签 c doxygen

我没有让 doxygen 预处理器递归包含文件。如何做到这一点?

我编写了一个包含两个 header 和一个 Doxygen 文件的示例:

subdir/example.h
subdir2/example_include.h
Doxygen

这是 example.h 的 list :

#include "example_include.h"

typedef struct
{
    float   array[ARRAY_LENGTH * 2 - 1];
#if CONDITION == MY_FALSE
    char        optional_char;
#endif
} ExampleType;

这是 example_include.h 的 list :

#define MY_FALSE            (0u)
#define MY_TRUE             (1u)
#define CONDITION       MY_TRUE
#define ARRAY_LENGTH    (20u)

我对默认 Doxygen 配置文件(使用 Doxygen 1.8.2)的更改是:

INPUT                  = .
RECURSIVE              = YES
GENERATE_XML           = YES
MACRO_EXPANSION        = YES
INCLUDE_PATH           = .

ExampleType 的 Doxygen 输出 XML(文件:xml/struct_example_type.xml)是:

<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.2">
  <compounddef id="struct_example_type" kind="struct" prot="public">
    <compoundname>ExampleType</compoundname>
      <sectiondef kind="public-attrib">
      <memberdef kind="variable" id="struct_example_type_1aa7b8f391fc62f93c34c2b305542db339" prot="public" static="no" mutable="no">
        <type>float</type>
        <definition>float ExampleType::array[ARRAY_LENGTH *2-1]</definition>
        <argsstring>[ARRAY_LENGTH *2-1]</argsstring>
        <name>array</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="D:/Sandboxes/ALN_Alignment_SRR295/04_Engineering/01_Source_Code/algo/exmaple/subdir/example.h" line="5" bodyfile="D:/Sandboxes/ALN_Alignment_SRR295/04_Engineering/01_Source_Code/algo/exmaple/subdir/example.h" bodystart="5" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="struct_example_type_1a8428371f21c1fb8fd28cb1062c7b1152" prot="public" static="no" mutable="no">
        <type>char</type>
        <definition>char ExampleType::optional_char</definition>
        <argsstring></argsstring>
        <name>optional_char</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="D:/Sandboxes/ALN_Alignment_SRR295/04_Engineering/01_Source_Code/algo/exmaple/subdir/example.h" line="7" bodyfile="D:/Sandboxes/ALN_Alignment_SRR295/04_Engineering/01_Source_Code/algo/exmaple/subdir/example.h" bodystart="7" bodyend="-1"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <location file="D:/Sandboxes/ALN_Alignment_SRR295/04_Engineering/01_Source_Code/algo/exmaple/subdir/example.h" line="4" bodyfile="D:/Sandboxes/ALN_Alignment_SRR295/04_Engineering/01_Source_Code/algo/exmaple/subdir/example.h" bodystart="3" bodyend="9"/>
    <listofallmembers>
      <member refid="struct_example_type_1aa7b8f391fc62f93c34c2b305542db339" prot="public" virt="non-virtual"><scope>ExampleType</scope><name>array</name></member>
      <member refid="struct_example_type_1a8428371f21c1fb8fd28cb1062c7b1152" prot="public" virt="non-virtual"><scope>ExampleType</scope><name>optional_char</name></member>
    </listofallmembers>
  </compounddef>
</doxygen>

实际上,我希望 ARRAY_LENGTH 被替换为 (20u) 并且 optional_char 不应该是该结构的成员。

看来我的问题与this有关,但是唯一有希望的答案是@Phineas 的评论说这是一个已在 doxygen 版本 1.7.4 中修复的问题。但是,我仍然看到相同的行为。怎么办?

顺便说一句——“用例”很简单:这是一个 Visual Studio 项目。编译器包含所需的所有文件,因为它们都包含在项目定义中。

最佳答案

Have you set RECURSIVE to YES?

# The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO.
# If left blank NO is used.

RECURSIVE              = YES

it's in the Doxyfile

source

需要说明的是,默认值为 NO。

关于c - 如何使 doxygen 预处理器递归到子目录中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13718958/

相关文章:

c - 其他C文件中声明和定义的划分

c - 用于执行后台进程的 Shell 项目

c - 如何使用指针打印元素

doxygen - 如何从 Doxygen 输出中排除变量?

doxygen - 如何从 graphviz/doxygen 中排除私有(private)方法?

c - 为什么有些函数特别长? (学术研究所需的想法!)

c++ - 如何使用 C API 为 MySQL 查询设置超时

latex - 关于 doxygen 中的 latex 配方

c++ - 如何使用 Doxygen 记录 C++ 函数中的局部变量

php - 使用 Doxygen 为 php 文件生成调用图