Total Pageviews

Wednesday, 26 August 2015

doxygen的使用方法

doxygen,一个从代码自动生成文档的小工具,很多类库的官方文档都是用它生成的
之前以为它和CVS一样神秘,很难用
今天试了试,真的是再简单易用不过了
doxygen 的window 版可以从
ftp://ftp.stack.nl/pub/users/dimitri/doxygen-1.3.9.1-setup.exe
下载到。linux版一般系统安装盘上就有
使用方式
到你的源代码的目录下
输入
doxygen -g
它会自动生成一个名为Doxyfile的配置文档
然后输入
doxygen Doxyfile即可(也可以直接输入 doxygen)
写代码的时候遵循现有的那些通用的c++规范就行了,唯一要注意一点的就是写注释的时候
要以///开头,而不是以前的//
因为我们通常有个习惯,//来注释掉暂时不用的代码
呵呵,当然,doxygen的功能相当丰富,更多的更详细的配置,就需要慢慢学了
当然,它有图形界面,但是我不喜欢用,速度还没有命令行快.
---------------------
Doxygen

Generate documentation from source code

Doxygen is the de facto standard tool for generating documentation from annotated C++ sources, but it also supports other popular programming languages such as C, Objective-C, C#, PHP, Java, Python, IDL (Corba, Microsoft, and UNO/OpenOffice flavors), Fortran, VHDL, Tcl, and to some extent D.
Doxygen can help you in three ways:
  1. It can generate an on-line documentation browser (in HTML) and/or an off-line reference manual (in $\mbox{\LaTeX}$) from a set of documented source files. There is also support for generating output in RTF (MS-Word), PostScript, hyperlinked PDF, compressed HTML, and Unix man pages. The documentation is extracted directly from the sources, which makes it much easier to keep the documentation consistent with the source code.
  2. You can configure doxygen to extract the code structure from undocumented source files. This is very useful to quickly find your way in large source distributions. Doxygen can also visualize the relations between the various elements by means of include dependency graphs, inheritance diagrams, and collaboration diagrams, which are all generated automatically.
  3. You can also use doxygen for creating normal documentation (as I did for the doxygen user manual and web-site).
Doxygen is developed under Mac OS X and Linux, but is set-up to be highly portable. As a result, it runs on most other Unix flavors as well. Furthermore, executables for Windows are available.

from  http://www.stack.nl/~dimitri/doxygen/index.html