![]() We will need to edit it to set a few things. Make sure you run this from the same directory that your average.cpp file is in! This will create a Doxyfile with the default options. To generate that file, run doxygen -g (the -g means "generate"). These are all kept in a file called Doxyfile. We need to tell doxygen what files to process, and a large number of other options. There is also a main() function in that file that reads in two doubles, calls average(), and prints out the result that function is not commented. Save the above code as a file called average.cpp ( src). Some tags, such as the tag, require a parameter. Note that five of the lines have tags, such as which means that the following comment is specifically about the return value. This is much more documentation than is probably necessary for the average() function, but the point is to show the functionality of doxygen. * Need to write acceptance tests for this function * This function computes the average using the standard accepted ** Computes the average of the two passed values. Note that, like Javadoc, the doxygen comments come before the code block to be documented. A function might be commented as follows. Thus, we are going to use a program called doxygen, which works on a dozen different languages, including C++. Javadoc is great for Java code, but does not work for C++ code. The source code is then run through a program called javadoc (which comes with the Java SDK), and the full online HTML documentation pages that we are familiar with are then created. ![]() A tag is a special command that denotes the comment is about some specific aspect, such as the parameter type or return value. If you look at the code itself, there are a lot of comments with special "tags" in the source code. However, there exist a number of documentation tools that allow us to do a lot more with our comments. So far, all of our documentation has been via regular comments. When writing large amounts of code, it is important to document it, both for your understanding later, as well as for other people's understanding (such as the graders). ![]() If it is a different version, then the line numbers will likely change, although they should be somewhat similar. These differences should not make any difference for the tags we are using.Ī note about line numbers: the line numbers shown throughout this document are for Doxygen version 1.8.6 (not the most recent version!) to find out what version you have installed, run doxygen -v. The version currently installing on Ubuntu Linux (both in the lab and on Virtual Box) may be a different version. Note that the current version of doxygen, as of the writing of this lab (released June 2015, and current as of late 2015), is 1.8.10. But see the very last paragraph of this lab for Mac-specific details. It will likely be easier to run doxygen through VirtualBox. Go up to the Tutorials table of contents pageĪ Mac OS X note: doxygen on a Mac is very hard to install and configure. I thought this would be an easy thing but it has turned into more of a pain than I had thought.PDR: Doxygen Tutorial PDR: Doxygen Tutorial Really, I'm trying to modify the dot files generated by Doxygen to contain these labels. I am trying to add two labels to a graph with dot, one at the top and one at the bottom of the graph. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |