自动生成C ++源和头(和更新副变化上反之亦然)文件 [英] Automatically generate C++ Source and Header (and update vice versa on changes) files
问题描述
有一些工具(希望emacs的),可以更新和添加正确的函数定义和其他的东西,以保持同步源(的.cpp)和头文件(.h)文件。
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?
我在做梦太多了?
推荐答案
这是几乎重复有人问<一个href=\"http://stackoverflow.com/questions/652779/automatically-separate-class-definitions-from-declarations\">here和我的<一个href=\"http://stackoverflow.com/questions/652779/automatically-separate-class-definitions-from-declarations/653758#653758\">answer介绍我们使用一个单一的文件去单独的头文件和源文件的工具: LZZ
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.
这篇关于自动生成C ++源和头(和更新副变化上反之亦然)文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!