开发者

Any cross platform way to build cpp skeleton from a header? [duplicate]

This question already has answers here: Creating .cpp files from .h files visual studio (5 answers) Closed 5 years ago.

I'm tired of copy pasting the header into my cpp file then hacking at it until its in the correct form. Has anyone made a program to read a he开发者_开发百科ader file and make a corresponding cpp skeleton? I need something that is cross platform or bare minimum works on Linux. A vim plugin would also be acceptable.

Example

class A
{
    public:
        int DoSomething( int number );
}

Would produce the following file

int A::DoSomething( int number )
{
    ;
}


http://www.vim.org/scripts/script.php?script_id=2624


You can try to play around with LazyCplusplus. Or you can try out Visual Assist X for Visual Studio.

Instead of strinking C++ from the records, I'd rather wait for C++ promised modules. :)

Edit : actually this seems a duplicate of your question : Seeking code stub generator (from header files)


Almost every IDE has built-in features or plugins that do that for you - e.g. for Visual Studio Visual Assist X provides many convenience features.
There are also many code generation utilities, you could also create one use yourself using e.g. gcc-xml and the scripting language of your choice.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜