Doxygen with * .in文件

问题描述 投票:0回答:1

我使用* .in文件生成函数

   class Foo
   {
   public:
   ...

      #define FUNCTION(returnType, getterName) \
         returnType getterName(uint8_t iValue) const;
      #include "Functions.in"
      #undef FUNCTION

   ...
   };

并想使用Doxygen。 Doxygen配置如下:

...
INPUT                  = Path/To/Foo
...
FILE_PATTERNS          = *.in \
                         *.c \
                         *.cc \
                         *.cxx \
                         *.cpp \
                         *.c++ 
...
SEARCH_INCLUDES        = YES
...
INCLUDE_PATH           = Path/To/Foo
...

我可以在文档中看到* .in文件,但不能看到类中的函数。此外,Doxygen会发出以下警告

Foo.h:10: warning: include file Functions.in not found, perhaps you forgot to add its directory to INCLUDE_PATH?

有人知道如何在* .in文件中使用Doxygen吗?实际上可以使用生成代码的Doxygen吗?

c++ documentation doxygen
1个回答
1
投票

如果你读the Doxygen preprocessing documentation,你会看到

用作doxygen输入的源文件可以通过doxygen的内置C预处理器进行解析。

默认情况下,doxygen仅进行部分预处理。也就是说,它评估条件编译语句(如#if)并评估宏定义,但它不执行宏扩展。

可以更改此默认行为:

如果要扩展CONST_STRING宏,应将配置文件中的MACRO_EXPANSION标记设置为YES

因此解决方案是不通过Doxygen运行*.in文件,而是将MACRO_EXPANSION配置变量设置为YES,宏将完全展开并且应该解析它们的扩展。

© www.soinside.com 2019 - 2024. All rights reserved.