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

Unified Diff: tools/json_schema_compiler/cc_generator.py

Issue 1982193002: Add enum class support to json_schema_compiler (idl files) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: I accidentally a patchset dependency Created 4 years, 7 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
« no previous file with comments | « no previous file | tools/json_schema_compiler/cpp_type_generator.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/cc_generator.py
diff --git a/tools/json_schema_compiler/cc_generator.py b/tools/json_schema_compiler/cc_generator.py
index 267d9fe8f106a4368a726cd1432e3cb2e10344fe..7e0ddc94828415b69cfb40caf91a634afdc01590 100644
--- a/tools/json_schema_compiler/cc_generator.py
+++ b/tools/json_schema_compiler/cc_generator.py
@@ -162,7 +162,7 @@ class _Generator(object):
else '')
items.append('%s(%s%s)' % (prop.unix_name,
namespace_prefix,
- self._type_helper.GetEnumNoneValue(t)))
+ self._type_helper.GetEnumNoneValue(real_t)))
elif prop.optional:
continue
elif t.property_type == PropertyType.INTEGER:
@@ -387,7 +387,7 @@ class _Generator(object):
(c.Append('} else {')
.Append('%%(dst)s->%%(name)s = %s%s;' %
(namespace_prefix,
- self._type_helper.GetEnumNoneValue(prop.type_))))
+ self._type_helper.GetEnumNoneValue(underlying_type))))
c.Eblock('}')
else:
(c.Sblock(
@@ -462,7 +462,7 @@ class _Generator(object):
c.Sblock('if (%s != %s%s) {' %
(prop_var,
maybe_namespace,
- self._type_helper.GetEnumNoneValue(prop.type_)))
+ self._type_helper.GetEnumNoneValue(underlying_type)))
else:
c.Sblock('if (%s.get()) {' % prop_var)
@@ -1128,7 +1128,7 @@ class _Generator(object):
dst,
prop.unix_name,
namespace_prefix,
- self._type_helper.GetEnumNoneValue(prop.type_)))
+ self._type_helper.GetEnumNoneValue(underlying_type)))
return c
def _GenerateError(self, body):
« no previous file with comments | « no previous file | tools/json_schema_compiler/cpp_type_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698