News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

create getter and setter automatically

Started by polisbul, December 23, 2012, 12:40:43 PM

Previous topic - Next topic

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
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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

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?
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...?!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

polisbul

#4
ok done it. thank you