Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Customizing eclipse CDT c++ new class template(Customizing eclipse CDT c++ new class template)
Customizing eclipse CDT c++ new class template [message #986583] Wed, 21 November 2012 04:23 Go to next message
ravi reddy is currently offline ravi reddy
Messages: 2
Registered: July 2012
Junior Member
I am using eclipse CDT Juno. Is it possible to customize C++ header and source files just after standard "New Class" dialog?

I want to change generated code a bit to include the copy constructor and assignment operator.

For example I want to add the following members to every generated class, so resulting class will looks like:

class ClassName
{
public:
ClassName();
virtual ~ClassName();

private:
// ---------- What I want to add: begin ---------
ClassName(const ClassName&);
ClassName& operator=(const ClassName&);
// ---------- What I want to add: end ---------
};
Re: Customizing eclipse CDT c++ new class template [message #987065 is a reply to message #986583] Fri, 23 November 2012 09:28 Go to previous messageGo to next message
Klaus Mr is currently offline Klaus Mr
Messages: 116
Registered: November 2011
Senior Member
Hello,

you could edit the existing template or add new templates:

http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Freference%2Fcdt_u_code_temp.htm&resultof=%22cdt%22%20%22templates%22%20%22templat%22

Hope this helps.

regards,
Klaus


Re: Customizing eclipse CDT c++ new class template [message #1071357 is a reply to message #987065] Fri, 19 July 2013 23:13 Go to previous message
Jess Vriesema is currently offline Jess Vriesema
Messages: 2
Registered: July 2013
Junior Member
I was struggling with how to do this as well and found your question. I finally figured out a workaround and posted it here. Hope you find it helpful! (I realize it's an old post.)

http:// stackoverflow.com / questions / 3285359 / eclipse-cdt-new-class-template / 17756834#17756834

(Sorry, this is my first post, so I can't post the URL directly.)

Mr Klaus was right -- but that's not the place to do it if you're trying to use the New Class Wizard.

Good luck!
Previous Topic:What setting is wrong here?
Next Topic:File Header Template
Goto Forum:
  


Current Time: Tue Sep 23 14:26:04 GMT 2014

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

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