rokojori-godot/rokojori-cpp-generator/source/cpp-creation/Header.ts

50 lines
731 B
TypeScript

export class Header
{
static create( className:string, extendingClassName:string,
headerDefine:string, protectedMembers:string,
publicMembers:string, includes:string,
forwardDeclarations:string )
{
let cppHeader =
`
/* ${className}.h */
#ifndef ${headerDefine}
#define ${headerDefine}
${includes}
${forwardDeclarations}
class ${className} : public ${extendingClassName}
{
GDCLASS( ${className}, ${extendingClassName} );
protected:
static void _bind_methods();
${protectedMembers}
public:
${publicMembers}
// Constructor
${className}();
// Destructor
~${className}();
};
#endif // ${headerDefine}
`
return cppHeader;
}
}