icoudot.java4cpp.java4cpp-templates.1.0.2.source-code.enum-template.ftl Maven / Gradle / Ivy
The newest version!
<@cppFormatter>
<#assign fileName = class.type.cppFullName?replace('::', '_')+"Enum.h"/>
#ifndef ${fileName?replace('.', '_')?upper_case}
#define ${fileName?replace('.', '_')?upper_case}
<#assign cppEnum = class.type.cppFullName?split("::")?last + "Enum"/>
<#list class.type.cppFullName?split("::") as namespace>
<#if namespace_has_next>namespace ${namespace} {#if>
#list>namespace ${cppEnum} {
typedef enum {
NULL_VALUE = -1,
<#list class.content.enumKeys as key>
${key}<#if key_has_next>,#if>
#list>
} ${cppEnum};
<#list class.type.cppFullName?split("::") as namespace>
}
#list>
#endif
@cppFormatter>
© 2015 - 2024 Weber Informatics LLC | Privacy Policy