July 20041 Doxygen A Code Documentation System Doxygen generates documentation directly from the structure and comments in the code –Browsable HTML documentation.

Slides:



Advertisements
Similar presentations
Kausik Datta Interra Systems India Pvt. Ltd.
Advertisements

Copyright © 2014 Pearson Addison-Wesley. All rights reserved. Chapter 17 Templates.
The Web Warrior Guide to Web Design Technologies
CS282.  Doxygen is a documentation generator for ◦ C++, C, C#, Java, Objective-C, Python, PHP, …  Doxygen will document your code according to the “tags”
Copyright © 2008 Pearson Addison-Wesley. All rights reserved. Chapter 12 Separate Compilation Namespaces Simple Make Files (Ignore all class references.
Advanced Object-Oriented Programming Features
Thinking inside the box 26 June 2003 Soar Workshop - Slide 1 © 2003 Soar Technology, Inc. Thinking… …inside the box SoarDoc Presented on Thursday, 26 June.
Doxygen and Javadoc By Derzsy Noemi.
JavaDoc COMP 302. JavaDoc javadoc: The program to generate java code documentation. Input: Java source files (.java)  Individual source files  Root.
Doxygen: Source Code Documentation Generator John Tully.
Concordia University Department of Computer Science and Software Engineering Click to edit Master title style ADVANCED PROGRAMING PRACTICES API documentation.
Introduction to Java Appendix A. Appendix A: Introduction to Java2 Chapter Objectives To understand the essentials of object-oriented programming in Java.
Recap, Test 1 prep, Composition and Inheritance. Dates Test 1 – 12 th of March Assignment 1 – 20 th of March.
Java Class Syntax CSIS 3701: Advanced Object Oriented Programming.
Operator Precedence First the contents of all parentheses are evaluated beginning with the innermost set of parenthesis. Second all multiplications, divisions,
chap13 Chapter 13 Programming in the Large.
C# B 1 CSC 298 Writing a C# application. C# B 2 A first C# application // Display Hello, world on the screen public class HelloWorld { public static void.
1 Doxygen National University of Kaohsiung Department of Applied Mathematics Yu-Kai Hong, Chien-Hsiang Liu, Wei-Ren Chang February, 2008.
C for Java Programmers Tomasz Müldner Copyright:  Addison-Wesley Publishing Company, 2000 Introduction to C Muldner, Chapters 1, 2.
More with Methods (parameters, reference vs. value, array processing) Corresponds with Chapters 5 and 6.
FLTK Tutorial.
JavaDoc1 JavaDoc DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY July 24, 2006 by Emil Vassev & Joey Paquet revision 1.2 –
07 Coding Conventions. 2 Demonstrate Developing Local Variables Describe Separating Public and Private Members during Declaration Explore Using System.exit.
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
Programming Languages and Paradigms Object-Oriented Programming (Part II)
A brief introduction to javadoc and doxygen Cont’d.
Program documentation Using the Doxygen tool Program documentation1.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
1 Documenting with Javadoc. 2 Motivation  Why document programs? To make it easy to understand, e.g., for reuse and maintenance  What to document? Interface:
Learners Support Publications Classes and Objects.
Javadoc: Advanced Features & Limitations Presented By: Wes Toland.
A First Simple Program /* This is a simple Java program. Call this file "Example.java".*/ class Example { // Your program begins with a call to main().
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
FLTK. Objectives Install and Use FLTK Widgets ◦Callbacks Handling event ◦System events ◦Mouse events ◦Keyboard events.
1 Chapter 12 GUI C/C++ Language Programming Wanxiang Che.
Software Documentation Section 5.5 ALBING’s Section JIA’s Appendix B JIA’s.
DANA uses a factory model to deliver data “just in time”
Documentation javadoc. Documentation not a programmer's first love lives in a separate file somewhere usually a deliverable on the schedule often not.
Javadoc A very short tutorial. What is it A program that automatically generates documentation of your Java classes in a standard format For each X.java.
Documentation Dr. Andrew Wallace PhD BEng(hons) EurIng
C Functions Three major differences between C and Java functions: –Functions are stand-alone entities, not part of objects they can be defined in a file.
JavaDoc and Contracts Spring Documenting Contracts with JavaDoc Contract model for methods Preconditions Postconditions JavaDoc Industry standard.
Programmeren 1 6 september 2010 HOORCOLLEGE 2: INTERACTIE EN CONDITIES PROGRAMMEREN 1 6 SEPTEMBER 2009 Software Systems - Programming1 Programming.
CSE IntroductiontoDoxygen. Contents Introduction Main Steps for creating documentation Examples.
OOP in C++ CS 124. Program Structure C++ Program: collection of files Source (.cpp) files be compiled separately to be linked into an executable Files.
CreatingClasses-SlideShow-part41 Creating Classes part 4 Barb Ericson Georgia Institute of Technology Dec 2009.
A brief introduction to doxygen. What does a compiler do?  A compiler ignores comments and processes the code.  What does doxygen do? –It ignores the.
A brief introduction to javadoc and doxygen. What’s in a program file? 1. Comments 2. Code.
Doxygen Documentation
Using HeaderDoc to make complete documentation as Html file. By Naveed Khalid.
July FLTK The Fast Light Toolkit • A C++ graphical user interface toolkit • Can be used under X, Windows, MacOS • Supports OpenGL • Provides: – Interactive.
1 Doxygen. 2 Doxygen: What is it ? ● A documentation generator – for C++, C, Java, Objective-C, Python, IDL (Corba and Microsoft flavors), Fortran, VHDL,
Problem Solving With C++ Doxygen Oct/Nov Introduction Doxygen is a documentation generator, a tool for writing software reference documentation.
Appendix 1 - Packages Jim Fawcett copyright (c)
Automatic Documentation Systems
Classes C++ representation of an object
Advanced Programing practices
Doxygen.
FLTK The Fast Light Toolkit
A brief introduction to doxygen
Doxygen Documentation
Introduction to javadoc
Class Commenting Doxygen for Classes.
Comments, Prototypes, Headers & Multiple Source Files
JavaDoc and Contracts Fall 2008.
Advanced Programing practices
Introduction to javadoc
Classes C++ representation of an object
Object Oriented Programming
Presentation transcript:

July Doxygen A Code Documentation System Doxygen generates documentation directly from the structure and comments in the code –Browsable HTML documentation –Printable LaTeX documentation –man pages Can be used with multiple programming languages – C++, C, Java, Objective-C, IDL Can extract structures from undocumented source code Configurable to generate various types of documentation

July Doxygen Doxygen uses a configuration file to determine –Wich code to extract documentation from –What type of documentation to create Doxygen uses the structure of the code to build –Class relations and diagrams –Index of functions and methods –Links between classes and methods and the locations they are used Doxygen uses special comments to –Provide descriptions of classes, methods, parameters, etc.

July Configuring Doxygen To use Doxygen a configuration file has to be created and configured –doxygen -g generates the generic configuration file Doxyfile Configuration files contain a number of tag assignments TAGNAME = VALUE that can be changed to obtain the desired documentation –INPUT tag defines the code files or directories –RECURSIVE indicates it subdirectories should be included –FILE_PATTERNS defines which files to build documentation for

July Configuring Doxygen Tags define what parts within the code should be documented –EXTRACT_ALL indicates if documentation should also be created for parts without documentation comments –EXTRACT_PRIVATE indicates if private members of classes should be included –EXTRACT_STATIC indicates if static members should be extracted –SOURCE_BROWSER defines if links to the source code should be created –INLINE_SOURCES can be used to include the relevant parts of the code into the documentation

July Configuring Doxygen Tags define what type of documentation should be created –OUTPUT_DIRECTORY defines where the documentation should be placed –HTML_OUTPUT, RTF_OUTPUT, LATEX_OUTPUT, MAN_OUTPUT, indicate if documentation in the particular format should be created

July Undocumented Code Example // generated by Fast Light User Interface Designer (fluid) version #include "Example.h" inline void HelloWorldUI::cb_Change_i(Fl_Button* o, void*) { if (o->value()) { o->label("Hello World"); dis->label("Change it"); } else { o->label("Change it"); dis->label("Hello World"); } o->redraw(); dis->redraw(); } void HelloWorldUI::cb_Change(Fl_Button* o, void* v) { ((HelloWorldUI*)(o->parent()->user_data()))->cb_Change_i(o,v); } Example.cpp HelloWorldUI::HelloWorldUI() { Fl_Window* w; { Fl_Window* o = win = new Fl_Window(340, 409, "HelloWorld"); w = o; o->labeltype(FL_NORMAL_LABEL); o->user_data((void*)(this)); { Fl_Tile* o = dis = new Fl_Tile(25, 130, 265, 255, "Hello World"); o->box(FL_SHADOW_BOX); o->end(); } { Fl_Button* o = new Fl_Button(120, 15, 215, 50, "Change it"); o->type(1); o->down_box(FL_UP_BOX); o->callback((Fl_Callback*)cb_Change); } o->end(); } int main(int argc, char **argv) { HelloWorldUI* main_window = new HelloWorldUI(); main_window->win->show(argc, argv); return Fl::run(); }

July Undocumented Code Example Example.h // generated by Fast Light User Interface Designer (fluid) version #ifndef helloworld_h #define helloworld_h #include class HelloWorldUI { public: HelloWorldUI(); Fl_Window *win; Fl_Tile *dis; private: inline void cb_Change_i(Fl_Button*, void*); static void cb_Change(Fl_Button*, void*); }; #endif Doxyfile Changes PROJECT_NAME = Example PROJECT_NUMBER = 1 OUTPUT_DIRECTORY = Docs1 EXTRACT_ALL = YES EXTRACT_PRIVATE = YES EXTRACT_STATIC = YES INPUT =. FILE_PATTERNS = *.cpp *.h RECURSIVE = YES INLINE_SOURCES = YES

July Undocumented Code Output After configuration, running doxygen will generate the documentation Docs1/index.html

July Documenting Code Documentation for Doxygen is created by including special comment blocks in the code –Doxygen supports multiple types of comment blocks C style with extra * : /** This is a C style comment block */ C++ style with extra / or ! : /// This is a C++ style comment The basic elements of documentation are brief and detailed descriptions –Brief descriptions are single line comments –Detailed descriptions are more elaborate –If both are used they have to be separated either in a different comment block, by adding an empty comment line, or by preceding the brief description with \brief

July Documenting Code Brief and detailed description for classes, methods, and members of a class do not require a keyword. –In methods, parameters and return values can be indicated with the \param and \return keywords Annotations for files, functions, variables, etc. require keywords for doxygen to be able to assign them –\file precedes descriptions for files –\var precedes global variables –\fn precedes funcions Within function blocks, \param and \return indicate parameters and return values \warning can be included to point out problems

July Documentation Example Example.h /*! * \file Example.h * \brief User Interface Header * * The header file for the user interface */ // generated by Fast Light User Interface Designer (fluid) version #ifndef helloworld_h #define helloworld_h #include /////////////////////////////////////////// /// /// This is the brief description of the user interface class /// /*! This class is used for the windos and contains the callback functions for the button that causes the swapping of the labels */ /////////////////////////////////////////// class HelloWorldUI { public: /*! * The class constructor */ HelloWorldUI();/*! * The main window pointer */ Fl_Window *win; /*! * The class constructor */ HelloWorldUI(); /*! * The pointer to the toggle button */ Fl_Tile *dis; private: /*! * This method inlines the callback code to make it permanently visible * \param o A pointer to the widget * \param v A pointer to additional data */ inline void cb_Change_i(Fl_Button* o, void* v); /*! * The main callback function * \param o A pointer to the widget * \param v A pointer to additional data */ static void cb_Change(Fl_Button* o, void* v); }; #endif

July Documentation Example Example.cpp /*! * \file Example.cpp * \brief User Interface Implementation * * The implementation file for the user interface */ // generated by Fast Light User Interface Designer (fluid) version #include "Example.h" inline void HelloWorldUI::cb_Change_i(Fl_Button* o, void*) { if (o->value()) { o->label("Hello World"); dis->label("Change it"); } else { o->label("Change it"); dis->label("Hello World"); } o->redraw(); dis->redraw(); } void HelloWorldUI::cb_Change(Fl_Button* o, void* v) { ((HelloWorldUI*)(o->parent()->user_data()))- >cb_Change_i(o,v); } HelloWorldUI::HelloWorldUI() { Fl_Window* w; { Fl_Window* o = win = new Fl_Window(340, 409, "HelloWorld"); w = o; o->user_data((void*)(this)); { Fl_Tile* o = dis = new Fl_Tile(25, 130, 265, 255, "Hello World"); o->box(FL_SHADOW_BOX); o->end(); } { Fl_Button* o = new Fl_Button(120, 15, 215, 50, "Change it"); o->type(1); o->down_box(FL_UP_BOX); o->callback((Fl_Callback*)cb_Change); } o->end(); } /*! * \fn int main(int argc, char **argv) * The main program * The main program operns up the window and then waits for mouse * events in the run loop * \param argc Number of arguments passed in on the command line * \param argv A pointer to an array of pointers to the arguments * \return Returns the error code upon termination * \warning Warnings are a good idea if particular pars are not * implemented */ int main(int argc, char **argv) { HelloWorldUI* main_window = new HelloWorldUI(); main_window->win->show(argc, argv); return Fl::run(); }

July Example Output After configuration, running doxygen will generate the documentation Docs2/index.html

July Generating Graphical Documents Doxygen also creates graphical representations (using the dot tools) for the code structure such as: –Class diagrams, Include and Collaboration graphs, etc. –The location of the dot tools has to be indicated using the DOT_PATH variable in the configuration file –For this to work HAVE_DOT has to be set to YES Graphs are enabled using definitions in the doxygen configuration file: –GRAPHICAL_HIERARCHY – display class hierarchy –CLASS_GRAPH – shows inheritance relations –INCLUDE_GRAPH – shows include dependencies –COLLABORATION_GRAPH – shows inheritance and usage –CALL_GRAPH – shows call relationship

July Example Output After configuration, running doxygen will generate the documentation Docs3/index.html For this simple program only include graphs will be created under the File Lists tab

July More Information More information and a complete list of possible keywords can be found in the Doxygen manual at