我如何告诉SWIG将源文件的文档复制到其生成的文件中?

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

我有一些包含文档的C API,例如

 // file: my_module.h

 /**
  * My function.
  * @param x A number.
  * @return Return.
  */
extern int my_function(int x);

我的swig文件

%module my_module
%{
#include "my_module.h"
%}

%include "my_module.h"  

例如,如果我为python生成包装器,我将生成此python包装器函数

 # file: my_module.py

 # < I want my docs copied here
 def my_function(x):
    return _my_module.my_function(x)

是否有一种方法可以告诉SWIG将我的文档复制到输出,以便在使用包装程序时可以在python编辑器的intellisense中看到我的文档?

documentation wrapper swig
1个回答
0
投票

我还没有尝试过,但是SWIG 4.0对doxygen注释提供了一些支持:

http://www.swig.org/Doc4.0/SWIGDocumentation.html#Doxygen

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