cimpl : Generates implimentations for C/C++ function prototypes
script karma |
Rating 31/10,
Downloaded by 1131 |
Comments, bugs, improvements
|
Vim wiki
|
created by |
Alexander Rodin |
|
script type |
utility |
|
description |
This script generates empty implementations for C/C++ functions from specified header file. For following header file
#ifndef TEST_H
#define TEST_H
class Test
{
public:
explicit Test(int val = 0);
int getVal() const
{
return m_val;
}
void setVal(int val);
friend const Test operator +(const Test& a, const Test& b);
private:
int m_val;
};
const Test operator + ( const Test &a, const Test & b );
#endif
output will be
Test::Test(int val)
{
}
void Test::setVal(int val)
{
}
const Test operator +(const Test& a, const Test& b)
{
}
|
|
install details |
You must have installed exuberant-ctags. Copy this script to ~/.vim/plugins. Also you can install tSkeleton (vimscript#1160) to add functions implementations in new source files.
This skeleton for .cpp files:
<+call:eval('findfile(expand("%:t:r").".h", ".;") != "" ? "\n#include \"".findfile(expand("%:r:t").".h", ".;")."\"\n" : ""')+><+call:eval('findfile(expand("%:t:r").".h", ".;") != "" ? "<+CURSOR+>".GenImpl(findfile(expand("%:r:t").".h", ".;")) : "\n<+CURSOR+>\n"')+>
will find .h files with same name in current directory and if it exists add implementations for definitions from header.
|
|
script versions (upload new version)
Click on the package to download.
ip used for rating: 18.189.11.177
|