Doxygen1.4.1

xiaoxiao2021-03-06  41

Use Doxygen to generate a standardized code document from the source code, including information such as annotation, class structure, class diagram, class inheritance relationship, and cross-reference relationship between functions. This makes us only need to maintain the source code, you can get the latest code level document at any time (different from the game logic process documentation). Doxygen's use is very simple. You can generate documents in a variety of formats, such as HTML, RTF, etc., such as HTML, RTF, etc., such as HTML, RTF. What we have to do is to write a comment in the usual format required by Doxygen, it can be said that it is always for all :) Note method brief introduction: Doxygen's annotation style standard can choose Qt and Javadoc style, I recommend using QT style, after all, is C comment. The annotation style is as follows: / *! Description of the function or class, writing the parameters of the function, the parameters of the function, as described below: / param AA's Description / Param BB can also explain the return value for the return value / return value * / Behind the code to comment (usually class or function) For member variables in the class, if you write, you may make the code not intuitive and neat, you can use / *!

In addition, the HTML tag can be written in the comment block for formatting. As can be seen, using Doxygen does not require us to get these exciting documents, which is almost disappointing for programmers with good comment writing habits. With the above foundation, we can write a comment to generate a document. In addition, Doxygen provides a number of tags in the comments to help us manage code and build a richer document, such as: / TODO to do what you want to do / BUG This code has defects Doxygen will list the list of corresponding items in the final document. At a glance. There are still a lot of similar tags, you can consult the Doxygen's documentation. These tags can be combined into very useful stuff and build a more abundant document. Everyone can share with each other and how to use Doxygen's experience and tips. About version: The latest version of Doxygen under Cygwin is 1.2.18. I downloaded the Windows version of Doxygen, the latest version is 1.4.1, which is selected under the Win32 platform because it can use the ATT's DOT tool to cooperate with Doxygen to generate more professional class diagrams. Everyone needs to install DOXYGEN and GRAPHVIZ (including DOT tools) Doxygen use configuration files: You can use Doxygen -G FileName to generate default configuration files, and then we have modified on this basis to adapt. Although the configuration file structure is complicated, the configuration item to be changed is not a lot, I read the configuration file, describe the configuration options we often modify as follows: Project_name project name, displayed on the document. Project_number engineering version number, can correspond to SVN-Version. Output_directory document output path. The language of the Output_Language document, default is ENGLISH. Although the corresponding proprietary noun has become Chinese, in order to facilitate the display of Chinese comments, it is recommended to use Chinese. The length of tab_size tab is modified according to each preference. The default is 8. EXTRACT_ALL is set to YES. Since our code is originally written in Doxygen format, there is no documentation. If you are NO, you only generate documents only for documentation files and data members. The default is NO. Extract_private is set to YES and generate a document for private members. The default is NO. Extract_static is set to YES, which generates a document for static variables. The default is NO. File_patterns To generate a file type of a document. We set the value * .cpp and * .h. Recursive generates a document on the files in the subdirectory of the specified directory. Exclude is the directory and file you want to go. We are set to .svn. Source_browser is set to YES to display the cross-reference relationship of the code. The default is NO. Alphabetical_index is set to YES to generate alphabet indexes of all combinations. The default is NO. COLS_IN_ALPHA_INDEX alphabet index table is divided into several columns, [1, 20]. The default is 5 generate_latex to generate the LaTex type file, and the default is YES. Include_path divides the header file outside the directory. Predefined can define a pre-processing macro, similar to GCC -D. Have_dot is installed with Graphviz to set it to YES, which will generate a better class diagram. Template_relations is set to YES, which can display the inheritance of the template and its real example. The default is NO.

转载请注明原文地址:https://www.9cbs.com/read-69219.html

New Post(0)