| Index: third_party/mojo/src/mojo/public/tools/bindings/generators/cpp_templates/enum_macros.tmpl
|
| diff --git a/third_party/mojo/src/mojo/public/tools/bindings/generators/cpp_templates/enum_macros.tmpl b/third_party/mojo/src/mojo/public/tools/bindings/generators/cpp_templates/enum_macros.tmpl
|
| deleted file mode 100644
|
| index 0e44acd57e65ce0bc4b131b73b8d5924eb3dd8a3..0000000000000000000000000000000000000000
|
| --- a/third_party/mojo/src/mojo/public/tools/bindings/generators/cpp_templates/enum_macros.tmpl
|
| +++ /dev/null
|
| @@ -1,46 +0,0 @@
|
| -{#---
|
| - Macro for enum definition, and the declaration of associated functions.
|
| - `is_static` is relevant if this enum declaration is defined within a class, in
|
| - which case associated functions need to be static.
|
| ----#}
|
| -{%- macro enum_decl(enum, is_static=false) %}
|
| -enum {{enum.name}} : int32_t {
|
| -{%- for field in enum.fields %}
|
| -{%- if field.value %}
|
| - {{enum.name|to_all_caps}}_{{field.name}} = {{field.value|expression_to_text}},
|
| -{%- else %}
|
| - {{enum.name|to_all_caps}}_{{field.name}},
|
| -{%- endif %}
|
| -{%- endfor %}
|
| -};
|
| -{{is_valid_enum_decl(enum, is_static)}}
|
| -{%- endmacro %}
|
| -
|
| -{#--- macros for the declaration & definitions of enum-associated functions.
|
| - Namely:
|
| - * {enum_name}_IsValidValue: returns true if the given enum has a valid value
|
| - for this generated version of enum.
|
| ----#}
|
| -
|
| -{%- macro is_valid_enum_decl(enum, is_static=false) %}
|
| -{% if is_static %}static {% endif -%}
|
| -bool {{enum.name}}_IsValidValue({{enum.name}} value);
|
| -{%- endmacro %}
|
| -
|
| -{%- macro is_valid_enum_def(enum, class_name = '') %}
|
| -{% if class_name != '' -%}
|
| -// static
|
| -bool {{class_name}}::
|
| -{%- else -%}
|
| -{{"bool "}}
|
| -{%- endif -%}
|
| -{{enum.name}}_IsValidValue({{enum.name}} value) {
|
| - switch (static_cast<int32_t>(value)) {
|
| -{%- for enum_field in enum.fields|groupby('numeric_value') %}
|
| - case {{enum_field[0]}}:
|
| -{%- endfor %}
|
| - return true;
|
| - }
|
| - return false;
|
| -}
|
| -{%- endmacro %}
|
|
|