Automatically generate C++ Source and Header (and

2019-06-16 06:11发布

Is there some tool (hopefully emacs) that can update and add the correct function definitions and other things to keep the source (.cpp) and the header (.h) files synchronized.

For example if I start doing this:

file: aaa.h

Class AAA {
   int b;
public:
   void func();
};

something that will automatically create and add:

file: aaa.cpp

void AAA:func() {

}

And any changes will appear on both?

Am I just dreaming too much?

3条回答
乱世女痞
2楼-- · 2019-06-16 06:33

An almost duplicate question was asked here and my answer describes the tool that we use to go from a single file to separate header and source files: lzz.

I don't know of any tool that can do the reverse translation.

查看更多
何必那么认真
3楼-- · 2019-06-16 06:33

Visual Studio + Visual Assist X does it (see Refactoring features).

But indeed, it's not emacs based :/

查看更多
姐就是有狂的资本
4楼-- · 2019-06-16 06:33

Xrefactory (fairly expensive tool) might be able to do what you are looking for. I haven't used it (I use Visual Studio + Visual Assist myself) but it shows up on a google search for 'emacs refactoring tools'.

查看更多
登录 后发表回答