User forums > Using Code::Blocks

create getter and setter automatically

(1/1)

polisbul:
is possible in codeblocks to write a script that generates getter and setter methods for a given class field?
abbreviations can't take any input (if i'm right!).
any other suggested way to do this would be very appreciated :)
thank you

MortenMacFly:

--- Quote from: polisbul on December 23, 2012, 12:40:43 pm ---is possible in codeblocks to write a script that generates getter and setter methods for a given class field?
abbreviations can't take any input (if i'm right!).
any other suggested way to do this would be very appreciated :)
thank you

--- End quote ---
You can do this in advance with the class builder (File -> New -> Class) or simply declare the setters / getters minimally in the header file and then in the source code, right-click at the place you want them to be, and select -> Insert -> All class methods w/o implementation, which will create all methods stubs for you.

polisbul:
I don't have the menu (File -> New -> Class), i'm running on code::blocks 8.02 on ubuntu 10.04.
Do I have to create the Class template?

MortenMacFly:

--- Quote from: polisbul on December 23, 2012, 04:23:52 pm ---i'm running on code::blocks 8.02 on ubuntu 10.04.
Do I have to create the Class template?

--- End quote ---
Sorry, but in this very old version is wasn't supported I'm afraid (alltough I don't recall exactly). I suggest you do an update. Out of curiosity: Why do you use such an old version anyways...?!

polisbul:
ok done it. thank you

Navigation

[0] Message Index

Go to full version