在Visual Studio 2010中使用Doxygen 使用Visual Studio 2010和C++可以有效地使用doxGEN。
除了“取消/注释行”之外,没有其他注释功能吗?例如,生成注释存根,并在新行后添加在Visual Studio 2010中使用Doxygen 使用Visual Studio 2010和C++可以有效地使用doxGEN。,c++,visual-studio-2010,documentation,doxygen,C++,Visual Studio 2010,Documentation,Doxygen,除了“取消/注释行”之外,没有其他注释功能吗?例如,生成注释存根,并在新行后添加// 另外,我想知道在VS2010的IntelliSense功能中显示这些注释需要什么?根据,任何使用/或/*分隔符的注释都将显示在IntelliSense成员列表中关联成员的旁边 您可以使用doxygen的XML输出或VisualStudio生成的XML作为IntelliSense输入 说明了如何将XML文档与IntelliSense结合使用: 要将生成的.xml文件与IntelliSense一起使用,请使.xml
//
另外,我想知道在VS2010的IntelliSense功能中显示这些注释需要什么?根据,任何使用/
或/*
分隔符的注释都将显示在IntelliSense成员列表中关联成员的旁边
您可以使用doxygen的XML输出或VisualStudio生成的XML作为IntelliSense输入
说明了如何将XML文档与IntelliSense结合使用:
要将生成的.xml文件与IntelliSense一起使用,请使.xml文件的文件名与要支持的程序集相同,并将.xml文件放在与程序集相同的目录中。在Visual Studio项目中引用程序集时,也会找到.xml文件
是用于doxygen/javadoc/DocXML文档的最佳Visual Studio外接程序之一。它不是免费的,但列表中没有任何东西是针对Visual Studio 2010的。我自己能想到的最好的东西就是宏集合。我四处寻找可能已经将一些有用的VisualStudio doxygen宏聚合在一起的网站,但到目前为止都是空的。但是,使用VisualStudio的代码模型自动填充文档非常方便。下面是我为插入符号当前所在的函数创建文档所做的宏:
Sub FunctionDoc()
DTE.UndoContext.Open("Function Doc")
Try
Dim caretPosition As TextPoint = DTE.ActiveDocument.Selection.ActivePoint
Dim element As CodeElement = _
caretPosition.CodeElement(vsCMElement.vsCMElementFunction)
If element.Kind <> vsCMElement.vsCMElementFunction Then
MsgBox("That is not a function")
Exit Sub
End If
Dim func As CodeFunction = element
If func Is Nothing Then
MsgBox("That is not a function")
Exit Sub
End If
Dim ts As TextSelection = DTE.ActiveDocument.Selection
ts.StartOfLine()
ts.NewLine()
ts.LineUp()
Dim functionName As String = func.Name
ts.Text = "//-----------------------------------------------------------------------------"
ts.NewLine()
ts.Text = "// FUNCTION "
ts.Text = func.FullName
ts.NewLine()
ts.Text = "/// \brief "
Dim endline As Integer = ts.BottomPoint.Line
Dim endoffset As Integer = ts.BottomPoint.LineCharOffset
ts.NewLine()
ts.Text = "/// "
ts.NewLine()
For Each param As CodeParameter In func.Parameters
ts.Text = "/// \param "
ts.Text = param.Name
ts.Text = ". "
ts.NewLine()
Next
If func.Type.TypeKind <> vsCMTypeRef.vsCMTypeRefVoid Then
ts.Text = "/// \return "
ts.Text = func.Type.AsFullName
ts.Text = " "
ts.NewLine()
End If
ts.Text = "//-----------------------------------------------------------------------------"
ts.MoveToLineAndOffset(endline, endoffset)
Finally
DTE.UndoContext.Close()
End Try
End Sub
子函数doc()
DTE.UndoContext.Open(“函数文档”)
尝试
Dim caretPosition为TextPoint=DTE.ActiveDocument.Selection.ActivePoint
作为CodeElement的Dim元素=_
caretPosition.CodeElement(vsCMElement.vsCMElementFunction)
如果element.Kind vsCMElement.vsCMElement函数
MsgBox(“这不是一个函数”)
出口接头
如果结束
Dim func作为CodeFunction=元素
如果func什么都不是,那么
MsgBox(“这不是一个函数”)
出口接头
如果结束
将ts设置为文本选择=DTE.ActiveDocument.Selection
t.StartOfLine()
t.NewLine()
ts.阵容()
Dim FUNCTION Name作为字符串=函数名
ts.Text=“//---------------------------------------------------------------------------------------”
t.NewLine()
ts.Text=“//函数”
ts.Text=func.FullName
t.NewLine()
ts.Text=“//\brief”
尺寸端点为整数=ts.BottomPoint.Line
Dim endoffset为整数=ts.BottomPoint.LineCharOffset
t.NewLine()
ts.Text=“//”
t.NewLine()
对于函数参数中作为CodeParameter的每个参数
ts.Text=“//\param”
ts.Text=参数名称
ts.Text=“”
t.NewLine()
下一个
如果func.Type.TypeKind vsCMTypeRef.vsCMTypeRefVoid,则
ts.Text=“//\return”
ts.Text=func.Type.AsFullName
ts.Text=“”
t.NewLine()
如果结束
ts.Text=“//---------------------------------------------------------------------------------------”
ts.MoveToLine和Offset(结束线,结束偏移)
最后
DTE.UndoContext.Close()
结束尝试
端接头
请随意编辑或重用此宏,我欢迎任何批评