visual studio c++添加文档注释,生成api文档

1 可自动添加文档注释的插件

Atomineer Pro Documentation for Visual Studio

single-user license,76美元

visual assist x

2 visual studio可通过/doc编译选项生成xml格式的代码,然后通过sandcastle等工具处理生成api文档

3 visual studio推荐的xml注释标记

1 1
1 1
1
1 1

summary用来添加给类添加注释,para用来增加一行。

// xml_summary_tag.cpp
// compile with: /LD /clr /doc
// post-build command: xdcmake xml_summary_tag.dll

/// Text for class MyClass.
public ref class MyClass {
public:
   /// MyMethod is a method in the MyClass class.
   /// Here's how you could make a second paragraph in a description.  for information about output statements.
   /// 
   /// 
   void MyMethod(int Int1) {}

   /// text
   void MyMethod2() {}
};

param用来说明参数,name用单引号或者双引号指明函数参数,如果函数参数名称不正确,将出现编译错误。 

// xml_param_tag.cpp
// compile with: /clr /doc /LD
// post-build command: xdcmake xml_param_tag.dll
/// Text for class MyClass.
public ref class MyClass {
   /// Used to indicate status.
   void MyMethod(int Int1) {
   }
};

 

你可能感兴趣的:(c和c++程序设计,c++/visual,studio常见问题)