This tutorial is for current version i.e. Greed 2.0-RC available on github.The tutorials I found on googling are for older versions, hence writing for new one.
I hope you have already downloaded the plugin and configured it.(if not please do it from above links).
Instructions —
1. Open the "Greed-2.0-RC-7.1.0.jar" file with Archive Manager by Right-Click and select option "Open With" and then "Archive Manager".
2. In the "Archive Manager" window open "templates" folder,then open "source" folder.
3. There you can see four ".tmpl" files, each for c++,java,python,cs.
4. Open "cpp.tmpl" by left double-click.
5. You will see file contents like this —
#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <typeinfo>
#include <fstream>
using namespace std;
class ${ClassName} {
public:
<span class="tex-span">{<i>Method</i>.<i>ReturnType</i>}</span>{Method.Name}(${Method.Params}) {
return ${Method.ReturnType;zeroval};
}
};
${CutBegin}
${<TestCode}
${CutEnd}
Donot Touch anything in "class" and below it.
You can modify it also according to your needs but first read about modifying it from above github page so that you don't end messed up.
- Add your customised template here and save it.
For exapmle —
#include<bits/stdc++.h>
using namespace std;
#define LL "%I64d"
#define sz(a) int((a).size())
#define pb push_back
#define mp make_pair
//----------------Your Template--------------------//
class ${ClassName} {
public:
<span class="tex-span">{<i>Method</i>.<i>ReturnType</i>}</span>{Method.Name}(${Method.Params}) {
return ${Method.ReturnType;zeroval};
}
};
${CutBegin}
${<TestCode}
${CutEnd}
So now you can use your CF template in TC with Greed plugin!!
I hope it helps.
Full text and comments »