Oracle® Solaris Studio 12.4: IDE Quick Start Tutorial

Exit Print View

Updated: October 2014
 
 

Adding Source Code Documentation

You can add comments to your code to generate documentation for your functions, classes, and methods. The IDE recognizes comments that use Doxygen syntax and automatically generates documentation. It can also automatically generate a comment block to document the function below the comment.

  1. In the quote.cc file, place your cursor on the line above the line int readNumberOf(const char* item, int min, int max) {.

  2. Type a forward slash and two asterisks (/**) and press Enter. The editor inserts a Doxygen-formatted comment for the readNumberOf class.

    image:Editor window with comment
  3. Add some descriptive text to each of the @param lines and save the file.

  4. Click the readNumberOf class to highlight it in yellow, and click one of the occurrences marks on the right to jump to a location where the class is used.

    image:Editor window with readNumberOf class highlighted
  5. Click the readNumberOf class in the line you jumped to, and press Ctrl-Shift-Space to show the documentation you just added for the parameters.

    image:Editor window showing documentation window with                                 documentation
  6. Click anywhere else in the file to close the documentation window, and click on the readNumberOf class again.

  7. Choose Source > Show documentation to open the documentation window for the class again.