Author Topic: How to change getters and setters format  (Read 5989 times)

rixxy

  • Guest
How to change getters and setters format
« on: September 13, 2014, 10:09:59 pm »
Hello all! I am new to this forum and am new to Code::Blocks, but am experienced using C++.
I am just trying to get C::B configured the way I want it and am having a small issue. When I create a new class using the wizard, it works well; I can add member variables right from the wizard which is sweet. And I can even get auto-generated getters and setters. My only issue is that I want to change the format of the generated getters and setters. As it stands, the getters and setters appear like: Getname() and Setname(). I, however, would like them to be camelCase eg: getName() and setName(). I could just manually edit every one, but then that defeats the purpose of having generated method names.
Is there an option to change this? I am using Code::Blocks version 13.12 on Ubuntu 14.04.

Thanks!
-Rixxy

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Re: How to change getters and setters format
« Reply #1 on: September 14, 2014, 11:30:47 pm »
sorry but there is no such options.

patches welcome ;)

greetings

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Re: How to change getters and setters format
« Reply #2 on: September 15, 2014, 02:27:14 am »
.... As it stands, the getters and setters appear like: Getname() and Setname(). I, however, would like them to be camelCase eg: getName() and setName(). I could just manually edit every one, but then that defeats the purpose of having generated method names.
Is there an option to change this? ....

Thanks!
-Rixxy

I am guessing the this is done by a CB Script.
Did you try just right clicking on the wizard icon and try editing the script?

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: How to change getters and setters format
« Reply #3 on: September 15, 2014, 06:16:34 am »
I am guessing the this is done by a CB Script.
Compiled plugin actually.
If you are building your C::B from source, it is a trivial change around lines 193-202 of plugins/classwizard/classwizarddlg.cpp .  (If you devise a more general purpose change, patches welcome.)