Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Create getters/setters with Doxygen documentation(Create getters/setters with Doxygen documentation)
Create getters/setters with Doxygen documentation [message #1497021] Wed, 03 December 2014 13:29 Go to next message
Niccolo\' Bulgarini is currently offline Niccolo\' BulgariniFriend
Messages: 4
Registered: December 2014
Junior Member
I've tried the last three versions of EclipseCDT on ubuntu but haven't been able to set the option for creating automatically the documentation within the getters/setters creation automatic procedure. I would like to get something similar to what I can obtain with CodeBlocks; this is an example:

/** Access Name
         * \return The current value of Name
         */
        std::string GetName() { return Name; }
        /** Set Name
         * \param val New value to set
         */


Can I have the same in Eclipse?
Thank you
Re: Create getters/setters with Doxygen documentation [message #1499015 is a reply to message #1497021] Thu, 04 December 2014 21:21 Go to previous messageGo to next message
Ron W is currently offline Ron WFriend
Messages: 8
Registered: December 2013
Junior Member
Looks like you would need to define your own template for that.

But, you could have the template create a "skeleton" version of the get/set methods:

/** Access ${name}
* \return The current value of ${name}
*/
${type} Get${name}() { return ${name}; }
/** Set ${name}
* \param val New value to set
*/
void Set${name}(${type} val) { ${name} = val; }
Re: Create getters/setters with Doxygen documentation [message #1499757 is a reply to message #1499015] Fri, 05 December 2014 11:35 Go to previous messageGo to next message
Niccolo\' Bulgarini is currently offline Niccolo\' BulgariniFriend
Messages: 4
Registered: December 2014
Junior Member
Thank you. How can I do it?
Re: Create getters/setters with Doxygen documentation [message #1500020 is a reply to message #1499757] Fri, 05 December 2014 16:10 Go to previous message
Ron W is currently offline Ron WFriend
Messages: 8
Registered: December 2013
Junior Member
It least in Eclipse Kepler, open Preferences, then under C/C++, Editor, Templates. Then either create a New template, or Edit an existing template. Give it a convenient name, then copy/paste my example in my previous post into the Pattern box and modify it for your needs/preferences. Then click Ok.

For more information, open the Help dialog, then under C/C++ Development User Guide, Tasks, Write Code, Working with Content Assist.

If you are using a different version of Eclipse, it should not be hard to find in that version's Help dialog.


Eclipse IDE for C/C++ Developers
Version: Kepler Service Release 2
Build id: 20140224-0627

Eclipse GCC Cross Compiler Support
Version: 8.3.0.201402142303
Previous Topic:can't send ctrl-C or ctrl-Break to the console in debug
Next Topic:CDT Luna 4.4.1 Indexer not compatible with boost
Goto Forum:
  


Current Time: Sat Sep 21 04:52:45 GMT 2024

Powered by FUDForum. Page generated in 0.02952 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top