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

Unified Diff: mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl

Issue 1527183003: Change mojo enums to be scoped enums in the generated C++ bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-binding-equals
Patch Set: Created 4 years, 12 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 side-by-side diff with in-line comments
Download patch
Index: mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl
index f7ad85426b3cf1d745a70d190058429e36de6946..d454183508bbdcae64cd1166f73ffdea1ab1d6f8 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl
@@ -16,6 +16,7 @@
#define {{header_guard}}
#include <stdint.h>
+#include <ostream>
#include "mojo/public/cpp/bindings/array.h"
#include "mojo/public/cpp/bindings/associated_interface_ptr.h"
@@ -49,8 +50,10 @@ namespace {{variant}} {
{#--- Enums #}
{% from "enum_macros.tmpl" import enum_decl -%}
+{% from "enum_macros.tmpl" import enum_stream_operator -%}
{% for enum in enums %}
{{enum_decl(enum)}}
+ {{enum_stream_operator(enum)}}
{%- endfor %}
{#--- Constants #}
@@ -154,6 +157,18 @@ typedef mojo::StructPtr<{{union.name}}> {{union.name}}Ptr;
{%- endfor %}
{%- endif %}
+{% for struct in structs %}
+{% for enum in struct.enums %}
+{{enum_stream_operator(enum)}}
+{%- endfor %}
+{%- endfor %}
+
+{% for interface in interfaces %}
+{% for enum in interface.enums %}
+{{enum_stream_operator(enum)}}
+{%- endfor %}
+{%- endfor %}
+
{%- if variant %}
} // namespace {{variant}}
{%- endif %}

Powered by Google App Engine
This is Rietveld 408576698