Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying C++ Application Development with Code::Blocks
  • Table Of Contents Toc
  • Feedback & Rating feedback
C++ Application Development with Code::Blocks

C++ Application Development with Code::Blocks

By : BIPLAB MODAK
2.3 (4)
close
close
C++ Application Development with Code::Blocks

C++ Application Development with Code::Blocks

2.3 (4)
By: BIPLAB MODAK

Overview of this book

Table of Contents (13 chapters)
close
close

Documentation generation


Documentation of code is very important for any project. It builds an overview of the written code, explains its usage, and helps developers understand the code. Code::Blocks allows generation of code documentation from the IDE itself.

Doxygen is a standard tool to create documentation from annotated C++ files. Code::Blocks comes with a plugin called DoxyBlocks that creates an interface with the externally installed doxygen tool.

We need to download and install doxygen tool first. Subsequently we can use DoxyBlocks plugin to generate documentation. Perform the following steps:

  1. Download doxygen from the following URL—http://www.stack.nl/~dimitri/doxygen/download.html. Also download doxygen-x.x.x-setup.exe file. Double-click on that file to install it.

  2. We need to connect DoxyBlocks plugin with doxygen tool. Go to DoxyBlocks | Open preferences… menu option. The following screenshot will be displayed:

  3. Click on the General tab. Next click on the Browse button next to Path To doxygen option and set the path to C:\Program Files\doxygen\bin\doxygen.exe.

  4. Next create a new C++ console project and add the following code to wizard generated main.cpp file:

    class A {
        public:
            A() {};
            ~A() {};
            virtual int CallMe(int a) = 0;
    };
    
    class B : public A {
        public:
            B() {};
            ~B() {};
            int CallMe(int a) {
                return a;
            }
    };
    
    int main() {
        return 0;
    }
  5. Navigate to DoxyBlocks | Extract documentation menu option or press Ctrl + Alt+ E key combination. Code::Blocks will now generate documentation of the project inside doxygen folder.

  6. Go to DoxyBlocks | Run HTML menu option or press the Ctrl + Alt + H key combination to open the newly created documentation in a Web browser.

    We can also add additional detailed description of function, class, etc to create a detailed documentation.

  7. Move the cursor to the beginning of B::CallMe() function and click on the DoxyBlocks | /** Block comment menu option or press Ctrl + Alt + B key combination. Code::Blocks will analyze the function parameters and will insert a default comment block suitable for doxygen tool. Adjust the comment block and our code will look similar to the following snippet:

            ~B() {};
            /** \brief Virtual function CallMe() is defined here
             *
             * \param a int
             * \return int
             *
             */
            int CallMe(int a) {
  8. Press Ctrl + Alt + E key combination to regenerate the documentation and use the Ctrl + Alt + H key combination to open it inside Web browser. Documentation of B::CallMe() will look similar to the following screenshot:

We can also customize DoxyBlocks plugin option to use advanced features of doxygen.

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
C++ Application Development with Code::Blocks
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon