Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In the .cpp, is there a way to auto-implement all the functions from its .h?

Tags:

c++

netbeans

I think this would increase the quality of life when devving, but google came up with nothing and I couldn't find anything specific inside inside Netbeans either.

What I want is to start with this header:

class bla
{
public:
    static void gfg(somearg asd);
};

Then I open the blank bla.cpp and pressed 'autoimplement'. After that, it would look like this:

#include "bla.h"

static void bla::gfg(somearg asd)
{
    //TODO: implement
    throw unimplemented("void bla::gfg(somearg) is unimplemented");
}

Anyone know of a tool like this?

like image 357
argoneus Avatar asked Jun 08 '12 22:06

argoneus


Video Answer


2 Answers

I found http://www.radwin.org/michael/projects/stubgen/

"stubgen is a C++ development tool that keeps code files in sync with their associated headers. When it finds a member function declaration in a header file that doesn't have a corresponding implementation, it creates an empty skeleton with descriptive comment headers."

This looks like it does exactly what you want it to do.

like image 57
Zéychin Avatar answered Oct 08 '22 18:10

Zéychin


Some time has passed and in the meantime the requested feature seems to have been implemented in netbeans. Refer to https://netbeans.org/bugzilla/show_bug.cgi?id=213811 , which also gives a description on how to use it:

Note:
Implemented CTRL+SPACE.
IDE suggest implementing of class method if CTRL+SPACE was pressed:
- inside file that already has at least one method definition
- between method declarations

like image 45
suluke Avatar answered Oct 08 '22 18:10

suluke