开发者

Using VBScript for the Doxygen FILE_VERSION_FILTER

I am using Visual Studio, and I would like Doxygen to create a todolist from my TODO tasks.

I found the article Getting Doxygen and MSVC TODO tags to work together, which suggested using the Doxygen FILE_VERSION_FILTER option to convert the MS style TODO to Doxygen style @todo, but the example uses sed, which is not available on the nightly build machine. A VBScript seemed like an appropriate solution, so I created the following script to do the replace:

Const ForReading = 1

' Input file is passed as argument
inputFilePath = Wscript.Arguments(0)

strOldText = "/{2,3}\s*TODO:{0,1}"
strNewText = "/// @todo"

' Read input file
Set fso = CreateObject("Scripting.FileSystemObject")
Set inFile = fso.OpenTextFile(inputFilePath, ForReading)

strText 开发者_运维百科= inFile.ReadAll
inFile.Close

' Create regular expression.
Set regEx = New RegExp
regEx.Global = True
regEx.Multiline = False
regEx.IgnoreCase = True
regEx.Pattern = strOldText

' Make replacement.
strNewText = regEx.Replace(strText, strNewText)

Set objStdOut = WScript.StdOut
objStdOut.Write strNewText

and I set the FILE_VERSION_FILTER option to:

FILE_VERSION_FILTER    = "cscript.exe //NoLogo Documentation/versionFilter.vbs"

Unfortunately, when I build my documentation using Doxygen, my todolist is not generated.

I have manually added @todo items to my code to verify that the Doxygen is set up correctly to generate a todolist.

The output of the script, when run from the command line, appears to do the replace correctly.

I have also verified that the script is being called when Doxygen is run, by saving the output to a file as well as to StdOut.

I've tried finding examples, but none use VBScript, or any tool that I have available. Any suggestions would be greatly appreciated.

Thanks

P.S. I looked at the output from Doxygen, and I noticed this error:

versionFilter.vbs(27, 1) (null): The pipe has been ended.

Where line 27 corresponds to the last line in the script. The file is partially output, and the full file is written to my test file. I'm not sure why StdOut would be closed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜