widl-nan
Version:
Auto generate native C++ addon source code by parsing Web IDL definition
33 lines (25 loc) • 604 B
Plain Text
{{
{{
{{~ getNonStaticPropertyMembers(it) :p:i }}
{{
var propertyType = idlType2CxxPropertyReturnType(p.idlType, it.refTypeMap);
var addrStr = '';
var ptrStr = '';
if (isInterface(p.idlType, it.refTypeMap)) {
addrStr = '&';
ptrStr = '*';
}
if (isArray(p.idlType, it.refTypeMap)) {
addrStr = '';
ptrStr = '';
}
}}
{{=propertyType}}{{=ptrStr}} get_{{=p.name}}() const {
return {{=addrStr}}this->{{=p.name}}_;
}
{{? ! p.readonly }}
void set_{{=p.name}}(const {{=propertyType}}& new_value) {
this->{{=p.name}}_ = new_value;
}
{{?}}
{{~}}