Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Side by Side Diff: mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_declaration.tmpl

Issue 1375313006: For c++, Generate enum classes instead of enum from mojom. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 {% from "enum_macros.tmpl" import enum_decl -%} 1 {% from "enum_macros.tmpl" import enum_decl -%}
2 class {{struct.name}} { 2 class {{struct.name}} {
3 public: 3 public:
4 using Data_ = internal::{{struct.name}}_Data; 4 using Data_ = internal::{{struct.name}}_Data;
5 5
6 {#--- Enums #} 6 {#--- Enums #}
7 {%- for enum in struct.enums -%} 7 {%- for enum in struct.enums -%}
8 {{enum_decl(enum, is_static=true)|indent(2)}} 8 {{enum_decl(enum, is_static=true)|indent(2)}}
9 {%- endfor %} 9 {%- endfor %}
10 10
(...skipping 26 matching lines...) Expand all
37 {%- endif %} 37 {%- endif %}
38 bool Equals(const {{struct.name}}& other) const; 38 bool Equals(const {{struct.name}}& other) const;
39 39
40 {#--- Struct members #} 40 {#--- Struct members #}
41 {% for field in struct.fields %} 41 {% for field in struct.fields %}
42 {%- set type = field.kind|cpp_wrapper_type %} 42 {%- set type = field.kind|cpp_wrapper_type %}
43 {%- set name = field.name %} 43 {%- set name = field.name %}
44 {{type}} {{name}}; 44 {{type}} {{name}};
45 {%- endfor %} 45 {%- endfor %}
46 }; 46 };
47
48 {#--- Enum Operators #}
49 {% from "enum_macros.tmpl" import global_enum_operators_decl -%}
50 {%- for enum in struct.enums %}
51 {{global_enum_operators_decl(enum, class_name=struct.name)}}
52 {%- endfor %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698