如何在Netbeans代码模板中将类名称用作变量?
您好,我正在尝试编写C ++代码模板,该模板允许使用.h或.cpp文件名作为名称值。
例如,我有classa.cpp:
#include <iostream>
#include <iomanip>
#include <fstream>
using namespace std;
#include <cstdlib>
#include <cstring>
#include "ClassA.h"
ClassA::ClassA() {
}
我使用netbeans IDE编写了一个代码模板:
${TIP default = "void"} ${MET}( ${ARGS default = "void"} );
${TIP} ${CLASS default = "Cls"}::${MET}(${ARGS} ) {
${selection}${cursor}
}
使用此模板我可以更改所有名称和类型,但是我想避免写$ {class default =“ cls”}并获得“ classa”(或当我使用此模板代码时,.h和.cpp文件的任何名称)而不是“ CLS”。
我该怎么做?
Hello I'm trying to write a C++ Code Template which allows use .h or .cpp file name as a name value.
For example I have ClassA.cpp:
#include <iostream>
#include <iomanip>
#include <fstream>
using namespace std;
#include <cstdlib>
#include <cstring>
#include "ClassA.h"
ClassA::ClassA() {
}
I wrote a Code Template using NetBeans IDE:
${TIP default = "void"} ${MET}( ${ARGS default = "void"} );
${TIP} ${CLASS default = "Cls"}::${MET}(${ARGS} ) {
${selection}${cursor}
}
Using this template I can change all names and types, but I want to avoid write ${CLASS default = "Cls"} and get "ClassA" (Or any name which .h and .cpp files have when I use this template code) instead of "Cls".
How I can do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论