在 Windows XP 上使用 doxygen 1.6.3 输入过滤器出现问题

发布于 2024-08-30 05:35:02 字数 820 浏览 6 评论 0原文

我正在尝试使用 doxygen 为我编写的一些 matlab 类生成文档。我正在使用 doxygen-matlab 包,包含一个 perl 脚本,用于将 matlab .m 文件拼凑成 C++ 风格的注释文件,以便 doxygen 可以读取它们。

在我的 doxyfile 中,我已经设置(根据说明)

FILTER_PATTERNS        = *m=C:/doxygenMatlab/m2cpp.pl

但是,当代码运行时,它似乎只是使用 .pl 的默认 Windows 设置打开脚本,而不是在输入文件上运行脚本。

IE,如果我将 .pl 与记事本关联,则记事本会为 doxygen 尝试解析的每个输入文件打开一次脚本。如果我将 .pl 与 perl.exe 关联,脚本将运行并抛出无参数错误

参数必须在 C:\doxygenMatlab\m2cpp.pl 第 4 行包含文件名 -1。

doxygen 文档说

Doxygen will invoke the filter program by executing (via popen()) the command <filter> <input-file>

所以我想知道 popen() 和 Windows 是否存在可以修复的问题。

I am trying to use doxygen to generate documentation for some matlab classes I have written. I am using the doxygen-matlab package, which includes a perl script to kludge matlab .m files into c++ style commented files, so that doxygen can read them.

In my doxyfile, I have set (according to the instructions)

FILTER_PATTERNS        = *m=C:/doxygenMatlab/m2cpp.pl

However, when the code runs, rather than running the script on the input files, it appears to just open the script using whatever the default windows setting for .pl is.

IE, if I associate .pl with notepad, the script is opened by notepad once for each input file doxygen is trying to parse. If I associate .pl with perl.exe, the script runs and throws the no argument error

Argument must contain filename -1 at C:\doxygenMatlab\m2cpp.pl line 4.

The doxygen documentation says

Doxygen will invoke the filter program by executing (via popen()) the command <filter> <input-file>

So I am wondering if there is some problem with popen() and windows that I could fix.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

远山浅 2024-09-06 05:35:03

根据 Doxygen 论坛,有使用 INPUT_FILTER 和 FILTER_PATTERNS 之间的行为差​​异。

我发现如果我做一些额外的(转义的)引用,我可以让 FILTER_PATTERNS 工作。例如,而不是:

FILTER_PATTERNS        = "*.m=sed -e 's|%%|//!|'"

尝试:(

FILTER_PATTERNS        = "*.m=\"sed -e 's|%%|//!|'\""

我所有的实验都是使用 doxygen 版本 1.8.6 完成的)

According to the Doxygen forums, there is a difference in behavior between using INPUT_FILTER and FILTER_PATTERNS.

I found that if I do some extra (escaped) quoting, I can get FILTER_PATTERNS to work. For example, instead of:

FILTER_PATTERNS        = "*.m=sed -e 's|%%|//!|'"

Try:

FILTER_PATTERNS        = "*.m=\"sed -e 's|%%|//!|'\""

(All of my experimentation was done with doxygen version 1.8.6)

披肩女神 2024-09-06 05:35:02

您可以尝试我在 Matlab 文件交换上发布的有关 doxygen 包的解决方法吗?

  1. 在 Doxyfile 中设置以下变量:
    INPUT_FILTER=perl m2cpp.pl
    FILE_PATTERNS=*.m

  2. 如果它不起作用,您应该尝试安装 ActivePerl :使用此版本的 perl,一切工作正常。

Could you try the workarounds I posted on the Matlab File Exchange regarding the doxygen package ?

  1. Set the following variables in the Doxyfile :
    INPUT_FILTER=perl m2cpp.pl
    FILE_PATTERNS=*.m

  2. If it doesn't work you should try to install ActivePerl : with this version of perl, everything is working fine.

云之铃。 2024-09-06 05:35:02

我尝试使用 Windows 命令提示符(“cmd”)重现该错误,并注意到以下内容:

  • 如果您调用“perl m2cpp.pl”,则会收到错误 -1,因为您没有指定要转换为 cpp 的 m 文件-文件。
  • 如果您调用“perl m2cpp.pl mfile”并且mfile的路径包含空格,则会收到错误1。
  • 将mfile移动到不包含空格的位置后,我得到了所需的输出。

现在回到 Doxygen。我尝试了你的建议,法布里斯,但没有任何运气。我阅读了 doxygen 帮助,发现 INPUT_FILTER 变量仅在 FILTER_PATTERNS 为空时才被读取和使用。

因此,我现在使用 INPUT_FILTER = "C:\Programme\MATLAB\R2009a\sys\perl\win32\bin\perl U:\doxygen_matlab\m2cpp.pl" 和一个空的 FILTER_PATTERNS 变量。通过此配置,您甚至可以将 PERL_PATH 变量留空。此外,包含空格的文件名似乎没有问题。

不幸的是,所有文件都使用上述配置进行解析,而不仅仅是 m 文件。但是,将 FILTER_PATTERNS 设置为类似 *.m=C:\Programme\MATLAB\R2009a\sys\perl\win32\bin\perl U:\doxygen_matlab\m2cpp.pl 不起作用,因为 doxygen 自动添加过滤后的 mfile 的名称并将该命令解释为 perl“m2cpp.pl mfile”。当然,文件“m2cpp.pl mfile”不存在,因为这是两个文件。

也许你可以找到解决这个问题的方法。同时,我建议您采用上述解决方法,并将 C 文件远离包含 m 文件的文件夹。

I tried to reproduce the error using the Windows command prompt ("cmd") and noticed the following:

  • If you call "perl m2cpp.pl" you get error -1 because you did not specify a m-file to be translated into a cpp-file.
  • If you call "perl m2cpp.pl mfile" and the path of mfile contains spaces, you get error 1.
  • After I moved the mfile into a location which does not contain spaces, I got the desired output.

Now back to Doxygen. I tried what you suggested, Fabrice, without any luck. I read the doxygen help and found out that the INPUT_FILTER variable is only read and used if FILTER_PATTERNS is empty.

Therefore, I now use INPUT_FILTER = "C:\Programme\MATLAB\R2009a\sys\perl\win32\bin\perl U:\doxygen_matlab\m2cpp.pl" and an empty FILTER_PATTERNS variable. With this configuration, you can even leave the PERL_PATH variable empty. Moreover, there seems to be no issues with file names that contain spaces.

Unfortunately, all files are parsed with the above configuration, not only m-files. However, setting FILTER_PATTERNS to something like *.m=C:\Programme\MATLAB\R2009a\sys\perl\win32\bin\perl U:\doxygen_matlab\m2cpp.pl does not work because doxygen automatically adds the name of the filtered mfile and interprets the command as perl "m2cpp.pl mfile". Of course, the file "m2cpp.pl mfile" does not exist, because these are two files.

Maybe you can find a solution to this problem. In the meantime, I suggest the workaround above and that you keep your C-files away from the folder that contains the m-files.

温柔女人霸气范 2024-09-06 05:35:02

编写一个简单的批处理文件,例如mfilter.bat,它从命令行获取一个参数:

C:\Programme\MATLAB\R2009a\sys\perl\win32\bin\perl U:\ doxygen_matlab\m2cpp.pl %1

更改 Doxyfile 中的设置:

FILTER_PATTERNS = *.m=mfile.bat

这对我来说是这样(在 Windows 平台上)

write a simple batch file, e.g. mfilter.bat, which takes one argument from command line:

C:\Programme\MATLAB\R2009a\sys\perl\win32\bin\perl U:\doxygen_matlab\m2cpp.pl %1

Change setting in Doxyfile:

FILTER_PATTERNS = *.m=mfile.bat

This did it for me (on a Windows platform)

带上头具痛哭 2024-09-06 05:35:02

我想我解决了这个问题:它来自 .pl 和要执行的程序之间的不良关联(可能是由于 Matlab 附带的 perl 安装错误?)。

要纠正此问题,您应该更改 .pl 文件的关联:在 Windows 命令提示符(“cmd”)中,只需键入 de 2 以下行:(

assoc .pl=PerlScript

ftype PerlScript=C:\Program Files\MATLAB\R20xx\sys\perl\win32\bin\perl.exe %1 %*

旧安装忘记了末尾的 %*,参数未传递到 m2cpp.pl 脚本)。

然后,按照通常的方式设置 FILTER_PATTERNS 一切都应该没问题,例如 FILTER_PATTERN=*m=C:\DoxygenMatlbab\m2cpp.pl

您能告诉我这是否解决了您的问题吗?

I think I solved this problem : it came from a bad association between .pl and the program to execute (maybe due to a bad installation of the perl shipped whith Matlab ?).

To correct this, you should change the association for the .pl files : in a Windows command prompt ("cmd"), just type de 2 following lines :

assoc .pl=PerlScript

ftype PerlScript=C:\Program Files\MATLAB\R20xx\sys\perl\win32\bin\perl.exe %1 %*

(the old installation forgot the %* at the end, the arguments were not passed to the m2cpp.pl script).

And then everything should be fine with the FILTER_PATTERNS set the usual way, for example FILTER_PATTERN=*m=C:\DoxygenMatlbab\m2cpp.pl

Could you tell me if this fixed your problem ?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文